Generating Synchronization Script
To generate SQL script that will synchronize two
databases:
- Choose Tools -> DB Difference Analyzer -> Compare Databases from the top-level menu.
The Diff Explorer will be opened in the explorer area of the Server Studio
workspace.
- In the top tree view of the Diff Explorer
highlight the source database. The source database is the one, which you
consider older or previously created.
- In the bottom tree view of the Diff Explorer
highlight the target database. The target database is the one, which
you consider newer or created after the source database was created.
- From the popup menu of either of the tree views,
select Compare. You can also use Compare button on the explorer toolbar. The
DB Diff Options dialog box will be opened.
- In the DB Diff Options dialog box, check the options
you want and press Compare button. For example, you might choose to run the
comparison only for stored procedures. You also can exclude table
fragmentation properties from the comparison if you want to compare only
logical schema properties, such as object names, column names, etc. The DB
Diff Output panel will be opened in the document area of the Server Studio
workspace.
- Choose Diff -> Generate Synch Script top-level menu or press Generate
Synchronization Script button. The Synchronization Script Options dialog box
will be displayed.
- Choose, which database has to be modified to synch it with another
database, and optionally select the list of objects that has to be modified.
Press OK button.
- The generated script will be displayed at the bottom of the DB Diff Output
panel. The left portion contains the list of modified objects in the generated
script. You can click on any object in the list to navigate to the place
in the script containing first reference to this
object.
Press Send to SQL Editor button, to send the generated script to the SQL
Editor component. You can use SQL Editor to modify and execute the generated
script.
To save the DB Diff report and the generated synchronization script in a
text file, press Save Report button.
You can also generate a synchronization script only for
selected two tables. To do it, just highlight required tables in the Diff
Explorer and choose Compare from the popup menu. After tables's
differences are displayed, press Generate Syncronization Script
button.