Published 29 October 2018
SQL Change Automation includes Code Analysis, which give you advice on errors and best practices when deploying to a database.
You can see the Code Analysis result under the 'SQL Code Issues' tab of the Release Report. The Release Report is generated as part of the New-DatabaseReleaseArtifact PowerShell cmdlet.
Configuring the Code Analysis rules
It's possible to configure which Code Analysis rules are enabled and disabled.
To do this you must create a Code Analysis Settings file. The simplest way to generate this file is through SQL Prompt.
Follow the instructions on the SQL Prompt Documentation about configuring Code Analysis rules. This should instruct you on how to generate a Code Analysis Settings file (this file has the '.casettings' extension), and save it to a custom location.
You can then provide the Code Analysis Settings file to the New-DatabaseReleaseArtifact cmdlet through the '-CodeAnalysisSettingsPath' argument. Ensure the environment that is running the cmdlet can access the Code Analysis Settings file you have generated.