Make SQL Server Database Changes deployment easy with “Schema comparison”

Dear friends,

“Database Changes deployment”

, hmm little bit scary topic. But don’t’ worry
Today I am going to give a brief introduction on

Schema Comparison feature of Visual Studio 2010.

I think most of the people are not aware of this. This tool is one of the best helping tools for your deployment process.
Suppose you have made all the changes in your local database which are related to stored procedure, database schema and by mistake you are not aware what changes you have made so far which are not exists in your staging or production server.
Your first thought is to compare both the database and generate script for changes and just deploy on target database.

So Visual Studio 2010 makes your life easy with a new Feature which is called “Schema Compare”.
Just follow the steps as show below and you are good to go for any database changes deployment :).
Step 1:- Open Visual Studio 2010 Go to Data Menu Schema compare then New Schema Comparison and click it. You will get following screen.

Schema Comparision
Step 2:- Just define the Source and target database connection string in the above screen and then press OK button. Once you press OK button the Visual Studio compare the source and target database each object like tables, columns, store procedures etc.

You will get following screen which shows difference in source and target database in “Update Action” column.

Schema comparision detail
Step 3:- With Update Action column you can choose whether you want to keep these changes in the final script or not as show in below fig

Schema compare action
Step 4:- Now when you are assure that you want selected changes on target server also then you can on “Export To Editor” or “Export To File” option as shown below

Export to File
Step 5:- Now you are ready to run the changes because you have all the changes script like I have in below fig.

Generate Script output

I hope you enjoyed this.
Enjoy learning & Sharing.
Thanks & Regards,
Rajat Jaiswal

Advertisements

2 thoughts on “Make SQL Server Database Changes deployment easy with “Schema comparison”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s