在SQL Azure数据库之间无法查询 [英] Can't query between databases in SQL Azure
问题描述
我有一个SQL Azure数据库服务器和我需要的数据库之间进行查询,但无法弄清楚如何做到这一点。
I have a SQL Azure Database Server and I need to query between the Databases but can't figure out how to accomplish this.
下面是我的数据库的结构:
Here is the structure of my databases:
- Server.X
- Database.A
- Database.B
- Database.C
- Server.X
- Database.A
- Database.B
- Database.C
在 Database.A 我有一个存储过程,需要检索数据的 Database.B 。通常情况下,我会引用相同的
数据库SELECT * FROM [Database.B]。[DBO]。[MyTable的]
但这并没有出现在SQL Azure中就可以了。In Database.A I have a Stored Procedure that needs to retrieve data from Database.B. Normally, I would reference the database like
SELECT * FROM [Database.B].[dbo].[MyTable]
but this does not appear to be allowed in SQL Azure.消息40515,级别15,状态1,行16
参照Database.B.dbo.MyTable数据库和/或服务器名称未在此版本的SQL Server的支持。有没有办法做到这一点上的数据库结束了吗?
Is there a way to do this on the database end?
在最终版本的数据库A和从数据库B C都将需要的数据。
In the final version Databases A & C will both need data from Database B.
推荐答案
更新:
根据光明的评论和答复,情况发生了改变,因为这个答案最初接受,现在有一个跨数据库查询按的https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
As per Illuminati's comment and answer, the situation has changed since this answer was originally accepted and there is now support for cross database queries as per https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
原来的答复(2013):
跨数据库查询在SQL Azure的支持。这意味着你需要或者数据库相结合,prevent的需要摆在首位,或单独查询数据库和基本都在你的应用程序加入的数据。的这篇关于在SQL Azure数据库之间无法查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!