Share via

Reference is not allowed when refrencing 2 databases

Sasha Sasha 200 Reputation points
2024-01-01T12:45:58.9933333+00:00

I have a databse ACB referencing from 2 databases.

When I try to create BACPAC file I have this error : Reference is not Allowed

How can I resplve it ?

Azure SQL Database
0 comments No comments

Answer accepted by question author

Amira Bedhiafi 42,936 Reputation points MVP Volunteer Moderator
2024-01-01T12:49:54.7833333+00:00

I really don't understand the need to reference two databases since all the databases are gathered under one logical server.

Check this old thread : https://stackoverflow.com/questions/45707120/microsoft-azure-sql

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. RahulRandive 10,506 Reputation points
    2024-01-01T15:03:46.9566667+00:00

    Hi Sasha Sasha

    For an export operation its recommended not to export bacpac from an active database, it does not guarantee transactional consistency.

    You can first copy it to a new database and use this database as the source of export - See this URL for more reference Copy a database - Azure SQL Database | Microsoft Docs. Hopefully this should resolve reference related errors.

    Thank you!

    Was this answer helpful?

    0 comments No comments

  2. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2024-01-01T13:47:42.9833333+00:00

    Hm, I what are you trying to do?

    Do you have three-part references like:

    SELECT * FROM thatdb.dbo.thattable
    

    You cannot do this in Azure SQL Database. The databases may be on the same logical server, but physically they can be located in different regions in different parts of the world.

    If you want to make cross-databases references you can set up external tables or you can use sp_execute_remote to run queries in the other database.

    Was this answer helpful?

    0 comments No comments

Your answer

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