We're trying out VS2010 database projects for a new development, using the following dev cycle:
- Use Management Studio to develop changes on a local DB instance (using the designers etc)
- Use VS2010 schema compare to sync / import these changes to the VSDB project
- Check in the VSDB project and run automated build / test etc
When I want to 'get latest' from source control, I then:
- Update the VSDB project files from source control
- Use Schema Compare to push the changes from the project to my local database instance
This is where it starts to break down... Because schema compare is trying to synchronise the two versions, it attempts to undo any changes I've made to my local database as part of my own feature development.
Obviously, you can tell schema compare to skip changes to the objects I've modified, but sadly this doesn't always work correctly: http://connect.microsoft.com/VisualStudio/feedback/details/564026/strange-schema-compare-behavior-sql-2008-database-projects.
Fundamentally, the problem exists because the definitions in the VSDB project are not automatically synchronised with my local database; thus I need to use Schema Compare to do a 'poor mans merge' every time I get a change.
One possible solution could be to:
- Use Schema Compare to sync any changes from my local DB to the VSDB project first
- Update the VSDB project from source control (therefore using the source control tooling to do the merge, rather than Schema Compare)
- Schema Compare the changes from source control into my local DB instance
...which is far from ideal.
Is RedGate SQL Source Control better in this regard?
What about the new 'Juneau' SQL toolset?
Your process is backwards which is why this is difficult. Changes should flow from VSDB to your database, not the other way around. Try this: