The SQL Toolkit™ provides an Application Program Interface that enables
you to automate SQL Compare™. Online help and sample projects are
provided to help you to use the toolkit.
You can use the SQL Compare API to synchronize multiple databases or upgrade your customers' databases without manual intervention.
You can use the API if you are familiar with programming in C#, Visual Basic .NET, or any other .NET language. The SQL Compare engine is implemented using .NET assemblies. You can reference them from Visual Studio 2005 or the development environment of your choice.
The SQL Compare API requires the .NET Framework version 2.0. Earlier versions of the .NET framework are not supported.
If you would like to access the tools without programming in .NET and you have purchased a Pro version of SQL Compare or SQL Toolbelt™, you can use the command line interface.
For more information, visit our Web site at www.red-gate.com, send us an e-mail at info@red-gate.com, or visit the Red Gate Software Support Forum.
Licensing the SQL Compare API
To use the SQL Compare API, you must have a SQL Toolkit license. If you do not have a license, you will be able to use the toolkit for 14 days, but you will not be able to redistribute your applications.
The assemblies
To automate SQL Compare, you use the following .NET assemblies:
This assembly contains routines used by SQL Compare. It provides functions to access and execute batches of SQL statements and other helper functions.
This is the engine behind SQL Compare. It provides classes used for comparing and synchronizing the schema of SQL Server databases.
Referencing the assemblies
You can access the SQL Compare engine from C#, Visual Basic .NET, or any other .NET language. The easiest way to do this is from within the Visual Studio environment. Add references in your project to RedGate.SQL.Shared.dll and RedGate.SQLCompare.Engine.dll
Using the API
For an overview of how you use the API to automate the comparison and synchronization of schema, see Comparing and Synchronizing Schema Using the API. For a detailed example, see Worked Example.
Sample API Projects
The SQL Compare API provides a number of sample API projects in C# and Visual Basic .NET. To download the sample API projects, click here.
The samples demonstrate how to:
- compare databases
- synchronize databases
- generate an object creation script
- receive feedback events
- load and save snapshots
- load and save projects
- synchronize a scripts folder
See Also
Distributing Your Applications
Frequently Asked Questions for the SQL Compare API