views:

265

answers:

2

I'm using visual studio 2010 database edition and running a schema compare against a SQL database instance to sync up new objects on the database which arent yet in my project (dbproj). My solution contains many projects some of which reference each other via database references. When I write updated from my schema compare to my target project any references to objects in my other projects get added as hard references and do not use the sqlcmd variables that get set up when adding a database references.

This causes my solution to have warnings and errors until I manually swap out the hard references for the sqlcmd variables. I've found I can re-make the database references which has an option to pick up all the hard references through the project but this is still cumbersome. Is there a way to use the existing set of sqlCmd variables defined for my project such that updated are written to my project with the variable references used?

A: 

My solution isn't exactly what you want to do, but it might help.. When I run into similar issues, I usually create a (temp) DB for the schema compare & use it instead of my project..

Shady M. Najib
+1  A: 

This is just a thought but we never make direct changes in the database and use our project to build against the db to produce a deploy script. By using the project as the master of all knowledge we feel this works very well for us.

We branch out to create our dev, test environments then merge the project when we deploy.

As for references, we found referencing the dbmeta file instead of the actual database was also useful as it makes all the projects more transferable.

Barry King