链接服务器未解决的参考问题

编程入门 行业动态 更新时间:2024-10-24 10:16:01
本文介绍了链接服务器未解决的参考问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试从我的VS2010数据库项目中引用链接服务器时,似乎无法解决"未解决的引用"问题。我已经搜索了解决方案,但似乎没有解决我的问题。我有以下项目 setup:

I cannot seem to resolve an 'Unresolved reference' problem when Iattempt to reference alinked server from within my VS2010 database project. I have searched for solutions and none of them seem to resolve my problem. I have the following project setup:

1.具有已定义链接服务器(ServerDB)的数据库服务器项目

1.A database server project with a defined linked server (ServerDB)

2 。具有存储过程的数据库项目(RefDB)

2. A database project (RefDB) with a stored procedure

3。第三个DB项目(TestDB),包含2个数据库引用 - 一个到ServerDB,一个到RefDB

3. A third DB project (TestDB) which contains 2 Database references - one to ServerDB and one to RefDB

4。从TestDB我尝试使用3部分名称引用RefDB中的存储过程 - 这是成功的(没有错误或警告)

4. From TestDB I attempt to reference the stored procedure in RefDB using a 3 part name - this is successful (no errors or warnings)

5。从TestDB我尝试使用4部分名称(通过链接服务器)引用RefDB中的存储过程 - VS2010返回'SQL04151未解析的对象引用'警告

5. From TestDB I attempt to reference the stored procedure in RefDB using a 4 part name (via linked server) - VS2010 returns a 'SQL04151 unresolved reference to object'warning

6。如果我在ServerDB项目中创建一个存储过程并从TestDB引用它(使用2部分名称),这可以正常工作(所以我知道我的dbschema引用是可以的)

6. If I create a stored procedure within the ServerDB project and reference this from TestDB (using a 2 part name) this works fine (so I know my dbschema references are okay)

7。我曾尝试使用sqlcmdvars来解决这个问题但无济于事。链接服务器定义实际上是指有效的服务器实例。区分大小写也不是问题。

7. I have tried using sqlcmdvars to resolve this but to no avail. The linked server definition does actually refer to a valid server instance. Case sensitivity is also not an issue here.

这个问题真的还没有解决方案,或者我在这里做错了什么?

Is there really still no solution to this problem or am I doing something wrong here?

谢谢

Graham

推荐答案

您好Grahamgoodwin,

Hi Grahamgoodwin,

您在此博客中看到的警告: blogs.msdn/b/gertd/archive/2009/06/10/system-objects -in-tempdb.aspx ,您可能想要修改数据库引用中的Literal Value,将其设置为RefDB。

The warning you see was discussed on this blog: blogs.msdn/b/gertd/archive/2009/06/10/system-objects-in-tempdb.aspx, You may want to modify Literal Value in database reference, set it to RefDB.

加法参考FYI:

  • connect.microsoft/VisualStudio/feedback/details/543657/4151-unresolved-reference-warning-for-tempdb 功能
  • social.msdn.microsoft/forums/en-us/vstsdb/thread/46810DB7-5C68-405C-AF6E-​​9DD389205751

最好的问候,

更多推荐

链接服务器未解决的参考问题

本文发布于:2023-11-07 06:35:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:链接   服务器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!