Setting up a project with a SQL Clone image as a baseline in SSMS
Published 21 July 2020
Projects are the primary artifact used when developing and deploying databases using SQL Change Automation. They contain a database's state, and a set of scripts that describe how to get to that state. Learn about SQL Change Automation projects.
This page will help you get started with developing databases with SQL Clone as a baseline using the SQL Change Automation SQL Server Management Studio (SSMS) add-in.
We’ll set up a new SQL Change Automation project which can be deployed against a new database. Specifically, we’ll:
- Create a new SQL Change Automation project within SSMS
- Set up a new development database
- Configure a SQL Clone image to use as a baseline
- Make changes to the development database, and use SQL Change Automation to generate migrations from the changes
Creating a new project
1. Open SQL Change Automation
In SSMS, start SQL Change Automation by clicking the SQL Change Automation icon in the toolbar. If it doesn't show here, it will be under the Tools drop-down menu.
2. Create a new project
Click New Project… to create a new project. This will open the project setup wizard.
Enter the details for your project. Click the Set development source button.
Select New Database. Select the server you would like to create your database on and the appropriate connection credentials. Specify a database name, and click OK.
You should now have a development database configured. Click Next to continue setting the project up.
The next page will allow you to specify a SQL Compare filter file for your project or set comparison options. We’re not going to add any filters or set any custom options in this project so click Next.
On the last page of the wizard, you can select a database from which to generate a baseline.
We’re going to baseline using a SQL Clone image. Click on Select SQL Clone image.
Select a valid SQL Clone server URL and SQL Clone image. Then click OK and Create project.
If you refresh your list of databases in the SSMS Object Explorer, you should see the newly created development database you specified in the project setup, generated from the specified SQL Clone image.
After your project has been set up, click Done to navigate to the Generate migrations page.
When we make changes to our development database, they will show up here. These migrations will be generated on the assumption that they will be deployed against a database in the same state as the SQL Clone image.
- Commit the SQL Change Automation Project to version control
- Make further development changes and generate migrations for them in the SQL Change Automation project
- Set up a continuous integration pipeline to deploy these changes to another environment (for example, production)