Visual Studio 2010 Database Project - Unresolved Reference to a Synonym

后端 未结 2 755
后悔当初
后悔当初 2020-12-14 20:08

We have a couple of synonyms that are being used to reference tables in a separate database (that\'s on the same server).

The actual synonyms are fine, but the store

2条回答
  •  臣服心动
    2020-12-14 20:29

    This happens because in the caller database you must add a reference to the dependent database and specify also a value for the database name. Look below:

    Database reference

    Then you can create your synonym using the following code:

    CREATE SYNONYM [dbo].[mytable] FOR [$(MasterDatabase)].[dbo].[mytable]
    

提交回复
热议问题