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.

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.

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
![]()
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

Step 5:- Now you are ready to run the changes because you have all the changes script like I have in below fig.
I hope you enjoyed this.
Enjoy learning & Sharing.
Thanks & Regards,
Rajat Jaiswal


Ultimate Rajat ……
Comment by Rakesh ghosh — January 8, 2013 @ 10:40 am |
[...] Friends, In last post we have seen how easy to find the database changes and generate script for the changes that will [...]
Pingback by Compare records of each tables of Source & Target database « Asp.net & Sql server fundas with Rajat Jaiswal — January 9, 2013 @ 6:32 pm |