SSDT unresolved reference ERROR SQL71561

 ̄綄美尐妖づ 提交于 2019-12-04 08:59:11

If these are for the current database, your best bet is to import the project, then just replace "MyDBName.dbo." with "dbo.". If you're trying to reference other databases, you should probably use SQLPackage to extract a dacpac for those, then add database references for them. When adding the database reference, do not choose the option to treat these as a variable unless the names of those databases change from environment to environment. E.g., if you reference MyDB1.dbo.Table1 in your project and "MyDB1" is always the name of that database, you should not try to use a DB Variable.

I've written about this on my blog. Maybe that will give some better examples.

http://schottsql.blogspot.com/2012/10/ssdt-external-database-references.html

and

http://schottsql.blogspot.com/2013/01/ssdt-publishing-and-referenced-databases.html

I thought I had the same issue, but following step 4 cleared it. I first forgot and left in the variable reference! Clearing the field let my project build correctly...

A possible solution is to add a database reference to the database that has the missing object. The reference needs a Data-tier Application (dacpac file) that can be easily generated on the solution with the database project that has the missing object. Press the right mouse button over the database project and selected Snapshot Project. The dacpac file is created on the Snapshots folder. The file should then be copied to a common folder for re-usability.

In the project with the error press the right mouse button over the References and selected Add Database Reference. The Add Database Reference dialog appears: 1. Select the dacpac file 2.Select the database location. The most common option is "Different database, same server" 3.Confirm that the Database name field is as expected 4.Clear the "Database variable" field in the dialog. If this field has a value the queries must use this variable and not the database name

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