You can now download the sample msdb database projects from Microsoft Code Gallery to create cross database references between your database project schema objects and the schema objects that reside within the msdb database.


We have provided msdb database projects for both Visual Studio Team System 2008 release of Database Edition as well as the Visual Studio Team Edition 2005 for Database Professionals Service Release 1 for both SQL Server 2000 and SQL Server 2005.


Cross-database references requires that you define a corresponding reference in the properties of your database project. If you refer to objects in other databases but you do not define the corresponding references in your project, warnings will appear. For each database that you reference, you can define SETVAR variables that correspond to the server and database that you want to reference. When you modify an object definition to include the reference, you can define it by using these variables instead of the explicit names of the server and the database. When you build the database project, the variables are replaced by the values that you specified.