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.
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.
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
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