unable to connect another data base in same server which is azure sql - through ssms

Srinivas Mantri 0 Reputation points
2024-05-17T05:49:15.5066667+00:00

User's image

Issue description:

Msg 40515, Level 15, State 1, Line 66

Reference to database and/or server name in 'sriniazpracticedbserver.database.windows.net.TARGET.dbo.data_trg' is not supported in this version of SQL Server.

Completion time: 2024-05-17T11:12:27.1510005+05:30

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,493 questions
{count} votes

2 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,551 Reputation points
    2024-05-17T09:03:21.6+00:00

    Hi @Srinivas Mantri In Azure SQL database, to create a database, a login must be one of the following:

    • The server-level principal login
    • The Azure AD administrator for the local Azure SQL Server
    • A login that is a member of the dbmanager database role

    Referring from this similar thread: Reference to database and/or server name is not supported in this version of SQL Server.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Erland Sommarskog 120.6K Reputation points MVP Moderator
    2024-05-18T14:46:59.58+00:00

    If I understand your question corrcetly, it seems like you are trying to do a cross-database/server reference. This is not possible in Azure SQL Database to do with three/four-part notation. You can do it if you set up external tables.

    Checkout the command CREATE EXTERNAL TABLE. Make sure that you are reading the description for Azure SQL Database. (This command exists in other editions of SQL Server as well, but with quite different functionality.)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.