我在 Visual Studio 中有一个 MS 数据库项目——在进行架构比较之后,我试图生成一个部署脚本,问题是我得到数百个未解决的引用错误,例如以下两个:
Error 385 TSD03006: View: [auditing].[AuditedEntities] has an unresolved reference to object [INFORMATION_SCHEMA].[REFERENTIAL_CONSTRAINTS]. D:\greatProject\Database\greatProject.Database\Schema Objects\Schemas\auditing\Views\AuditedEntities.view.sql 4 14 greatProject.Database
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]. D:\greatProject\Database\greatProject.Database\Schema Objects\Schemas\auditing\Views\AuditedEntities.view.sql 5 69 greatProject.Database
SPROCS 在运行时永远不会出现问题。有没有一种快速而肮脏的方法来解决这个问题?也许甚至通过关闭参照完整性检查?