SQL Change Automation 4

Verifying a project in Visual Studio

Verifying a project allows you to validate the SQL in your scripts and check the integrity of the project by deploying it against the shadow database.

Each time you use SQL Change Automation to generate migrations from a database, it will create a migration script. It is possible to edit these migrations to give greater control over how your changes will be deployed. To ensure that the project will successfully be deployed to other environments, it is recommended that you perform a local verification of the project.

Refresh

You can deploy your project to the shadow database to ensure that the scripts will run successfully by clicking on the Refresh button in the SQL Change Automation window.

Errors indicate issues with the project that must be resolved before it can be deployed. If the issues are due to one of the files in your project, you can click Edit script to start editing the file. You are also able to open the SQL Server error log to view the the specific problem with the script.

Build

You can check each of your migrations and programmable objects for valid SQL and see any errors by clicking the Visual Studio Build button.

Once the verification has completed, you can view any errors or warnings:

  • Errors indicate issues with the project that must be resolved before it can be deployed
  • Warnings indicate potential issues that can cause unexpected behavior

If the issues are due to one of the files in your project, you can double-click on the file in the Visual Studio Error List to navigate to the issue.

Deploying to the shadow database on build

If you want your shadow database to be deployed when building in Visual Studio, there is a flag that can be toggled in the project properties.

Right click your SQL Change Automation project in the Solution Explorer, and select Properties.

Navigate to the Debug tab in the properties window, and uncheck Skip shadow database deployment when building inside Visual Studio.

Clean

When deploying to the shadow database via refresh or build, the database isn't dropped unless the migration log table isn't in sync with your project. If you want to validate your project against an empty shadow database, you can click on the Visual Studio Clean button to drop your shadow database before verification.



Didn't find what you were looking for?