Setting up a project with a SQL Source Control project in SSMS
Published 12 December 2019
We'll cover setting up a new SQL Change Automation project with a SQL Source Control project as the development source for your changes. You will need a SQL Source Control project to get started.
- Create a new SQL Change Automation project using our SQL Source Control project
- Set up a shadow database
- Generate a migration from changes in the SQL Source Control 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. If it doesn't show here, it will be under the Tools drop-down menu.
2. Create a new project
Click New project…. This will open the project setup wizard.
Enter a Project name and click Browse... to launch a file explorer window to choose where you want to save your project. Click Set development source… to open the development source dialogue. Choose SQL Source Control Project and browse to the location of your project.
Press OK to confirm your development source.
Back on the wizard page, click Next.
The next page will allow you to specify a SQL Compare filter file for your project. We’re going to filter out a DDL trigger from our baseline of the existing database. We have specified a SQL Compare filter file, Filter.scpf . Import this filter file by clicking the Apply filters button, and click Browse... to launch a file explorer window.
Click Next to proceed.
We're not going to baseline this project at this stage (we can come back to this later) so we'll select Don't baseline and press Create Project.
This will set up a new SQL Change Automation project for us.
In order to generate migrations, a shadow database must be set by clicking Set shadow database in the warning message.
In the dialog, provide the connection details for the shadow database and click OK.
You can now generate migration scripts by pressing Generate migrations.