SQL Comparison SDK™
Walk-through: Using Red Gate APIs
This walk-through will show you:
- Using the SQL Compare API to automate comparison and synchronization tasks
- Features in the SQL Comparison SDK
- Building your application
Stop walk-through
Step 4: Creating database objects
We want to compare and synchronize two databases.
To do this, we need to create two database objects that represent the two databases involved in the comparison:
Database db1=new Database();
Database db2=new Database();db1.Register(new ConnectionProperties(".", "WidgetStaging"), Options.Default);
db2.Register(new ConnectionProperties(".", "WidgetProduction"), Options.Default);
We could choose to use databases from a previously saved snapshot, which would be useful for an offline comparison but, in this case, we have registered databases from a live server.
Note the use of IntelliSense when you are writing code.





