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
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!