Database references for system objects

A database project configured in Visual Studio will have database references to external and internal databases it requires. While I would strongly advise against crossing database boundaries using this mechanism, there are legacy systems that require this. Part of bringing those legacy databases into standard development and deployment patterns means setting up database projects and publish profiles.

For your own databases that is a trivial task, but what do you do when using the system metdata. Examples of these areĀ sys.objects, sys. tables and more. These objects raise errors in the pattern “Object 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”. Fortunately these are easy to resolve. Continue reading →