We have two databases: "D1" and "D2". Each database has one table, say T1 in D1 and T2 in D2. Now I want to write a storage procedure in the D1 database that will access the table in the D2 database, something like the code below ...
USE D1
GO
Create or replace sp_test
(
SELECT * FROM D2.dbo.T2
)
GO
Any idea how I can do this?
Note. We used to use both databases on the same server. Therefore, I had no problems. But now, after switching to Azure, I donβt know how we can do this. Also, according to my information, we do not have a related server function available in SQL-Azure.
source
share