Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hi All,
I've two views in two different Azure SQL database:
both DB1 , DB2 is in the same server. I need to join these two views. When i ran the select query it is throwing the below error:
Msg 40515, Level 15, State 1, Line 30
Reference to database and/or server name in 'DB2.dbo.view2' is not supported in this version of SQL Server.
This is my select query:
select top 10 * from [DB1].[dbo].[view1] t
left join [DB2].[dbo].[view2] cr on t.InternalGTECode = cr.New_Engagement_Mirror_Code
i tried to run this query in both db as well as the master db.. but getting the reference error. Please help
Thank you for reaching out to the Microsoft Fabric Forum Community.
As per my knowledge, You are using Azure SQL Database, and in this service cross-database queries are not supported. Even if DB1 and DB2 are on the same logical server, Azure SQL Database isolates each database, so you cannot use three-part naming like DB2.dbo.view2. That is why you are getting Msg 40515. To fix this, you must either use Elastic Query (create an external table to access DB2 from DB1), move both views into the same database, or use Azure SQL Managed Instance, which supports cross-database joins.
If you still have issue or doubts please do reach out to Azure SQL forum, they will help you on this.
Azure SQL | Microsoft Community Hub
Thanks.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Fabric update to learn about new features.