Lesson Learned #307:Reference to database and/or server name is not supported in this version
Published Jan 27 2023 02:24 AM 11.3K Views

Our customer got the following error message: Msg 40515, Level 15, State 1, Line 19 - Reference to database and/or server name in 'DbName.dbo.TableName' is not supported in this version of SQL Server, executing the following TSQL: select * into [DbName].[dbo].[TableName] from [TableName2] 

 

As we mentioned, in this URL: https://techcommunity.microsoft.com/t5/azure-database-support-blog/cross-database-query-in-azure-sql...This requires accessing tables on different DBs using 3 part naming that is not possible in Azure SQL Database but in Azure SQL Managed Instance is possible.
 

If we need to use Azure SQL Database, the recomendation is to use external tables - https://techcommunity.microsoft.com/t5/azure-database-support-blog/cross-database-query-in-azure-sql...
 

Version history
Last update:
‎Jan 27 2023 02:24 AM
Updated by: