SQL Server Data Tools 2010 未解决的参考错误 SQL71561 [英] Unresolved Reference Error SQL71561 with SQL Server Data Tools 2010

查看:38
本文介绍了SQL Server Data Tools 2010 未解决的参考错误 SQL71561的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在单个解决方案中将 SSDT 2010(最新更新,v10.3.21208.0)与多个数据库项目一起使用时出现错误.错误内容如下:

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]

我已经阅读了可以在 Stack Overflow 和 Google 上找到的所有其他资源.以下是我已经尝试过的一些方法:

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

  • 设置对解决方案中其他项目的数据库引用.
  • 清除了数据库变量选项以绕过根据配置选项动态更改数据库名称的 SQLCLR 变量.
  • 确保在所有项目中禁用为通用对象启用扩展 Transact-SQL 验证
  • 数据库位置选项设置为:不同的数据库,相同的服务器
  • 确保项目构建顺序按逻辑安排
  • 尝试了 this 帖子
  • 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:

推荐答案

已经有一段时间了,但我仍然想与其他人分享这个解决方案,他们可能会关注我最初丢失的链接.密切注意第 4 步.这为我解决了问题.

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.

一个可能的解决方案是添加一个对具有缺失对象的数据库的数据库引用.该引用需要一个数据层应用程序(dacpac 文件),该应用程序可以在具有缺少对象的数据库项目的解决方案上轻松生成.在数据库项目和选定的快照项目上按鼠标右键.dacpac 文件是在 Snapshots 文件夹中创建的.然后应将该文件复制到一个公用文件夹以供重复使用.

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. 选择 dacpac 文件
  2. 选择数据库位置.最常见的选项是不同的数据库,相同的服务器"
  3. 确认数据库名称字段符合预期
  4. 清除对话框中的数据库变量"字段.如果此字段具有值,则查询必须使用此变量而不是数据库名称

这篇关于SQL Server Data Tools 2010 未解决的参考错误 SQL71561的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆