SQL Change Automation in SSMS

Set-up a new project


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 using the SQL Change Automation SSMS Extension.

We’ll set up a SQL Change Automation project by creating a new development database from scratch. Specifically, we’ll:

  • Create a new SQL Change Automation project within SSMS
  • Set up a new development database
  • Make changes to the development database, and import the changes into the SQL Change Automation project

Creating a new project

1. Open SQL Change Automation 

In SSMS, start SQL Change Automation by clicking on the SQL Change Automation icon in the toolbar.

This will open the SQL Change Automation window if it is not already open.

2. Create a new project

Click ‘New Project…’ to create a new project. This will open the project setup wizard.

Click the ‘Select development database…’ button. This will open the database connection dialog. Select the ‘New’ tab at the top of the dialog.

Select the server you would like to create your database on and the appropriate connection credentials. Specify a database name, and click ‘OK’.

Back on the wizard page, browse to a location where you want your project to be saved.

Fill in the project name.

The next page will allow you to specify a SQL Compare filter file for your project. We’re going to skip this step for now by clicking the ‘Skip’ button.

You can read more SQL Compare filters here.

On the last page of the wizard, you can select a database from which to generate a baseline.

We’re going to skip this step, by clicking ‘Skip and Finish’. You can read more about project baselines here.

If you refresh your list of databases in SSMS, you should see the newly created database you specified in the project setup.

After your project has been set up, you'll be navigated to the 'Generate migrations' page.

Capturing database changes in the project

SQL Change Automation projects contain a representation of the schema of your development database. Whenever you make a change to your development database, SQL Change Automation can automatically capture those changes.

Make a change to the development database you specified in the project. For instance, you could create a new table.

Navigate to 'Generate migrations' or refresh the page.

The Generate migrations page contains an overview of the differences between your development database and your SQL Change Automation project. In this case I created a table called ‘Users’.

Click ‘Generate migrations’ to capture those changes in the project.

When the migrations have been generated, the summary page will appear.

You can view and manage all generated scripts by navigating to the 'Migrations' page.

Summary

This page has explained how to automatically generate migrations in a new SQL Change Automation project with a new development database.

Next Steps

  • Make further development changes and import them to the SQL Change Automation project
  • Commit the SQL Change Automation Project to source control
  • Set up a continuous integration pipeline to deploy these changes to another environment (e.g. production)

Related worked examples




Didn't find what you were looking for?