In the development or maintenance of the project, often change the database used, or add, modify fields, or add tables, change stored procedures, etc., and there will be a number of similar databases at the same time (such as over a similar project, to use a slightly different database), this time may need to do the database schema comparison, See what the similarities and differences between the databases are in each project.
In the past, mainly by each modification left a script to track changes in the database, if the forgotten write update script or update script can not find, it is difficult to compare the schema, and the latest VS2012 in the database schema comparison of the tool, and the comparison can be generated after the update script, the specific steps are as follows:
First, open the SQL Server Object Explorer VS2012, load the database, such as:
All libraries are listed in the database list.
Second, in the database to be compared, such as YYGL_JX, right-click, in the pop-up menu to select the schema comparison, the following window will pop up, the current database name appears on the left side, now need to select the right target database
After you select a database in the drop-down box, click the Compare button in the upper-left corner
When the comparison is complete, click to update the database to the left to the database on the right, and click the button to generate the updated script.
Comparison of database schemas in VS2012