如何解决 SQL Server 数据库项目未完全限定的对象的构建错误?
刚刚创建了一个数据库项目并导入了一个大型现有数据库。我有数百个错误,主要与对不完全限定的对象的模糊引用有关。如何在不检查和更正 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要明确的是,数据库项目中的视图引用不在项目中的对象?
您可以创建包含所有这些对象的数据库对象的已编译 .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!