Reputation: 11
I want to copy data from one database table into another database table on the same server in Azure SQL. I have done all of the Azure SQL Cross Database Query' steps that are written here https://www.mssqltips.com/sqlservertip/6445/azure-sql-cross-database-query/but still get the same error whenever I execute a query 'Reference to database and/or server name in 'db name' is not supported in this version of SQL Server.'
Can you pls help to figure out this?
Upvotes: 1
Views: 1042
Reputation: 16401
Azure SQL database doesn't support across query directly.
We can not use USE
statements and it not supported. That's why you get the error. We can not run statements like select * from [other_database].[schema].[table]
.
In Azure SQL database, only elastic query overview (preview) can achieve cross database query:
You could follow the tutorial and it may be more complex than on-premise SQL Server: Get started with cross-database queries (vertical partitioning) (preview)
Upvotes: 1