如何解决 SQL Server 数据库项目未完全限定的对象的构建错误?

发布于 2024-12-28 11:26:28 字数 692 浏览 1 评论 0原文

刚刚创建了一个数据库项目并导入了一个大型现有数据库。我有数百个错误,主要与对不完全限定的对象的模糊引用有关。如何在不检查和更正 Visual Studio SQL Server 2008 数据库项目中的数百个文件的情况下修复或抑制这些错误?

这是我看到的错误示例:

SQL03006: View: [dbo].[vwEdiPOlineItem] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [REDACTEDNAME].[dbo].[Customer].[REDACTEDNAME]::[dbo].[Customer].[CustId], [REDACTEDNAME].[dbo].[Customer].[CustID] or [dbo].[ediBuyerToCustID].[REDACTEDNAME]::[dbo].[Customer].[CustId].    
C:\TFS\REDACTEDNAME\Main\Src\Database\Title\Title\Schema Objects\Schemas\dbo\Views\vwEdiPOlineItem.view.sql 62  47  Title

Just created a database project and imported a large existing database. I have hundreds of errors mostly related to ambiguous references to objects that are not fully qualified. How can I fix or suppress these errors without going through and correcting hundreds of files in my Visual Studio SQL Server 2008 Database Project?

Here's an example of an error I'm seeing:

SQL03006: View: [dbo].[vwEdiPOlineItem] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [REDACTEDNAME].[dbo].[Customer].[REDACTEDNAME]::[dbo].[Customer].[CustId], [REDACTEDNAME].[dbo].[Customer].[CustID] or [dbo].[ediBuyerToCustID].[REDACTEDNAME]::[dbo].[Customer].[CustId].    
C:\TFS\REDACTEDNAME\Main\Src\Database\Title\Title\Schema Objects\Schemas\dbo\Views\vwEdiPOlineItem.view.sql 62  47  Title

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

冰魂雪魄 2025-01-04 11:26:28

需要明确的是,数据库项目中的视图引用不在项目中的对象?

您可以创建包含所有这些对象的数据库对象的已编译 .dbschema 文件,并将其简单地包含在您的数据库项目中。您可以通过命令行等来完成。这需要一些工作,但我认为为了数据库的完整性这是值得的。

http://msdn.microsoft.com/en-us/library/aa833181.aspx

http://msdn.microsoft.com/en-us/library/dd193283.aspx

我还认为在 sqldeploy 设置文件中名为“EnfourceMinimalDependencies”或类似的内容可能会有所帮助。

祝你好运!

To be clear, the view in the db project referencing object that are not in the project?

You can create a compiled .dbschema file of the database objects that includes all those objects and simply include it in your db project. You can do it through the command line, ect. It takes some work, but i think its worth it for integrity of your database.

http://msdn.microsoft.com/en-us/library/aa833181.aspx

http://msdn.microsoft.com/en-us/library/dd193283.aspx

I also think in the sqldeploy settings file something called or is similar to "EnfourceMinimalDependencies" that may help.

Good luck!

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