Visual Studio 2010 Database Project - Unresolved Reference to a Synonym

隐身守侯 提交于 2019-11-28 21:27:43
Raffaeu

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:

Then you can create your synonym using the following code:

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

I have the same problem with table synonyms that point to another database on the same server as the main database. Adding the reference works for almost everything but in-line table-valued functions. As soon as you try to use a synonym

create synonym syn.Table for [$(MyDb)].[dbo].[Table];

in such a function the error is back. SSDT 2013 Update 4 is my version. It's just unbelievable that in 2016 such an error is still with us. Handling synonyms should be seamless as this is the prime mechanism for abstracting dependencies. Can't believe it's still not been corrected.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!