dj1smsu

I work in a data warehouse environment, and we are striving to move to some sort of source control for our database objects. We've been testing DB Pro as a solution to this, but when you bring in over 10,000 database objects that have been created over the past 3 years, you tend to run into problems. We have ~20 databases on our production server, many which reference each other with 3 part naming conventions. Of course these references would throw errors when loading the project. With the creation of database references I was hopeful that this would solve our issue. Instead I receive an error I am familiar with when doing application development, that of circular references. My question is, in a database environment, why does it matter

So if database A needs to query B, I can add a reference to B, but if B needs to query A, I cannot add a reference to B as this will cause a circular reference.

So, why does this artificial problem exist, when in the end SQL Server doesn't care


Re: Visual Studio Team System - Database Professionals Circular database references

Jeff Welton MSFT

What you are running into is the VS limitation on project references. Fortunately, you can achieve the behavior that you want through the use of references to .dbmeta files.

Taking your example of databases A and B. If add projects for both to your solution, you can build each project to create a .dbmeta file for each. .dbmeta files contain the metadata for each project necessary for other projects to reference them, somewhat akin to an assembly reference in .NET making assembly type metadata available to other assemblies. For the sake of this discussion we'll say that the build for DB project A results in the creation of A.dbmeta and the build of DB project B results in the creation of B.dbmeta. Now, in the Solution Explorer you can add a DB reference to DB project A that refers to DB project B. To do so, go to the Add Database Reference menu item, as before, but instead of creating a project reference, point the reference to B.dbmeta. In turn, in the Solution Explorer you can add a DB reference to DB project B that refers to DB project A. To do so, go to the Add Database Reference menu item, as before, but instead of creating a project reference, point the reference to A.dbmeta

At this point you should have the name resolution you expect without complaints from VS about circular references.

Your point that database projects are fundamentally different from, say, .NET projects and should allow mutual (circular) project referencing is, in my view, a very valid one.






Re: Visual Studio Team System - Database Professionals Circular database references

Gert Drapers - MSFT

The main reason is that we do a full database build, not many partial builds to create a deployment script. See my blog on database references http://blogs.msdn.com/gertd/archive/2007/07/26/database-references.aspx there is a limitations section at the end.

-GertD




Re: Visual Studio Team System - Database Professionals Circular database references

dj1smsu

Is this something that is hoped to be rectified in the future





Re: Visual Studio Team System - Database Professionals Circular database references

Gert Drapers - MSFT

We plan to address this in Visual Studio Team System "Rosario".

-GertD

http://blogs.msdn.com/gertd