Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved Reference Error SQL71561 with SQL Server Data Tools 2010

I am getting an error when using SSDT 2010 (latest updates, v10.3.21208.0) with multiple database projects in a single solution. The error reads the following:

SQL71561: View: [dbo].[View] has an unresolved reference to object [OtherDatabase].[dbo].[OtherTable]

I've read all the other resources I could find on Stack Overflow and Google. Here are some things I've already tried:

  • Setup Database References to the other projects within the solution.
  • Cleared out the Database variable option to bypass the SQLCLR variable that dynamically changes your database name based on configuration options.
  • Ensured that Enable extended Transact-SQL verification for common objects is disabled on all projects
  • Have the Database location option set to: Different database, same server
  • Ensured the Project Build Order is arranged logically
  • Tried the suggestions from this post

Nothing seems to be working for me. Any help would be much appreciated. Here is a screenshot that might shed more light on my problem:

Image showing my visual studio window with the error

like image 581
Jondlm Avatar asked Aug 14 '26 02:08

Jondlm


1 Answers

It has been a while, but I still want to share this solution with others that may be following the same lost links I was initially. Pay close attention to step 4. That cleared the issue for me.

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
like image 119
Flora Avatar answered Aug 16 '26 13:08

Flora



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!