VS 2010构建数据库项目收到SQL04151

发布于 2024-08-27 17:05:40 字数 229 浏览 5 评论 0原文

我刚刚开始使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

送君千里 2024-09-03 17:05:40

我需要用 [$(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.

世界等同你 2024-09-03 17:05:40

在您的 [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.

时光瘦了 2024-09-03 17:05:40

检查您是否已在指定对象的属性窗格中将构建操作设置为构建

Check you have set Build Action to Build on Properties pane for the specified object..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文