VS 2010构建数据库项目收到SQL04151
我刚刚开始使用 Visual Studio 2010 Premium 数据库项目。我必须说它确实很摇滚。我不明白的一件事是如何避免 SQL04151 警告
过程:[dbo].[MyProc] 有一个 未解析的对象引用 [我的数据库].[dbo].[我的项目].
我是否在某个地方错过了一个简单的步骤?我在网上能找到的所有内容都涉及 tempdb。
I just started working with the Visual Studio 2010 Premium database project. I must say it does indeed rock. One thing I can't figure out is how to avoid the SQL04151 warning
Procedure: [dbo].[MyProc] has an
unresolved reference to object
[MyDatabase].[dbo].[MyItem].
Did I miss a simple step somewhere? All I can find online involves tempdb.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我需要用 [$(DatabaseName)].[dbo].[MyTable] 替换 [MyDatabase].[dbo].[MyTable]。这清除了警告。
感谢您的帮助。
I need to substitute [MyDatabase].[dbo].[MyTable] with [$(DatabaseName)].[dbo].[MyTable]. This cleared up the warnings.
Thanks for your help.
在您的
[dbo].[MyProc]
过程中,您引用[MyDatabase].[dbo].[MyItem]
,它可能不是您的数据库项目的一部分。尽管该对象存在于数据库中,但 Visual Studio 在编译期间并不知道该对象,因此会产生错误。通常,您应该在数据库项目中拥有整个数据库模式。否则,我认为您可以研究一下所谓的“部分数据库项目”。
In your
[dbo].[MyProc]
procedure you reference[MyDatabase].[dbo].[MyItem]
which is probably not part of your DB project. Even though the object exists in the DB, it is not known to Visual Studio during compilation and thus yields an error.Normally you should have the entire DB-schema in the DB-project. Otherwise I think there is something called "partial DB projects" that you can look into.
MS 已承认这是他们正在解决的错误:
https://connect.microsoft.com/VisualStudio/feedback/details/543657/4151-unresolved-reference-warning-for-tempdb
MS has acknowledged this as a bug they are working on:
https://connect.microsoft.com/VisualStudio/feedback/details/543657/4151-unresolved-reference-warning-for-tempdb
检查您是否已在指定对象的属性窗格中将构建操作设置为构建。
Check you have set Build Action to Build on Properties pane for the specified object..