When you create an SCA project, it automatically launches a wizard that will help you set up the new project.
These scripts can be customized as needed. We will not examine those scripts in this article but, for example if this were a greenfield project, and so the database did not exist, the pre-deployment script creates the database. The Pre-Deployment and Post-Deployment folders each contain a default script that SCA creates. Each is numbered and named by SCA, but they can be renamed if needed. The team can control the order in which these run, but by default they will run in the ordering that they appear. The Migrations folder will contain our set of database migration scripts, each one describing a distinct change to the database. If you are adding this project to an existing solution, it will appear as part of that solution, alongside any other projects that already exist. Once I click OK, SCA will create the project for me and set up a simple solution with several folders, which you can see in solution explorer. I also selected the option to create a directory for the solution and create a new Git repository in this location.
I called mine simply “ SQLChangeAutomation” and put in my local user Repos folder. Give the project a name and choose a location for it. You can see this in the screenshot below, with the SQL Change Automation project type selected. You’ll find the SQL Change Automation Project in the Other Languages group, beneath the SQL Server item. You do have the option to search for online templates as well. Most of these are grouped by languages, though the exact list will depend on which templates you have installed. You’ll see the usual list of Visual Studio project templates. To begin database development, startup Visual Studio and use the File – New – Project menu to create a new project. SCA is a plug-in for Visual Studio that creates a new SQL Change Automation project type.
This will be a Brownfield development project, to upgrade an existing database, so you’ll need a SQL Server instance and database with existing objects (creation script for my sample database is here) Creating a Project
SQL Server Management Studio is optional as the SQL Server Object Explorer in Visual Studio can be used instead.