简体   繁体   中英

How to copy one table data to another one between two Azure databases on the same server

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?

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:

  • The elastic query feature (in preview) enables you to run a Transact-SQL query that spans multiple databases in Azure SQL Database. It allows you to perform cross-database queries to access remote tables, and to connect Microsoft and third-party tools (Excel, Power BI, Tableau, etc.) to query across data tiers with multiple databases.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM