sql-servervisual-studiodatabase-projectgdr

Unresolved references in Microsoft Visual Studio SQL Database project


I have a MS DataBase project in Visual Studio.

After doing a Schema Comparison, I am trying to generate a deploy script.

The problem is I get hundreds of Unresolved references errors,such as the following two:

Error   385 TSD03006: View: [auditing].[AuditedEntities] has an unresolved
reference to object [INFORMATION_SCHEMA].[REFERENTIAL_CONSTRAINTS].

Error   387 TSD03006: View: [auditing].[AuditedEntities] 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:
[INFORMATION_SCHEMA].[REFERENTIAL_CONSTRAINTS].[C]::[CONSTRAINT_NAME],
[INFORMATION_SCHEMA].[REFERENTIAL_CONSTRAINTS].[CONSTRAINT_NAME]
or [INFORMATION_SCHEMA].[TABLE_CONSTRAINTS].[C]::[CONSTRAINT_NAME].

The SPROCS never have issues when they run.

Is there a quick and dirty way to fix this?

Perhaps even by turning off referential integrity checks perhaps?


Solution

  • I added a reference to the master database to resolve this error, which can be achieved through the following steps.

    1. Right click References under your database project
    2. Click Add Database Reference...
    3. Click the `Database project schema (.dbschema) radio button
    4. Browse to the

      C:\Program Files\Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema

    5. Click OK

    The following question is related. ASP.NET Schema Tables Causing Issues in VSTS