views:

512

answers:

1

Hi all,

I have a question about creating a deployment script using a database project in Visual studio 2008.

In a more traditional project we would create a deployment script that would create the DB and the initial objects for the first deployment. This would become the baseline.

Any additional objects would be scripted as ALTER statements. Each statement would check for the existence of the object, giving a re runnable database deployment script.

I want to be able to do the same thing with the database project, but it currently analyses the database and creates a script to take it from its current state to where the project specifies it should be. This is fine for local deployment, but I cannot use this to deploy to production, as they require a re runnable script that will not loose any data in the live system.

My first idea was to have a copy of the database that matches live, and then point the project to it to generate the statements for the deployment, but it does not seem very maintainable.

Does anyone have any idea about how achieve this?

Thanks

A: 

This is done by the Schema Compare option of the Database Edition of Visual Studio.

I Think you could find useful this link: How to: Compare Database Schemas