This error can occur when Deploying a Database Release (which corresponds to the Use-DatabaseReleaseArtifact if using Powershell).
On this step SQL Change Automation attempts to deploy an update script generated on the Create Database Release step (corresponds to New-DatabaseReleaseArtifact).
Since there might be a time delay between script creation and deployment and also because the script can be applied to a different target than the one that was used in the Create Database Release step, a pre-update schema check is carried out before the script is applied.
The pre-update schema check compares the scripts folder States/Target in the Deployment Resources with the Target Database using SQL Compare and originates the error if the scripts folder is not identical to the Target Database.
This check compares both the schema and static data.
How to access the database deployment resources
If using:
- Powershell - Use the Export-DatabaseReleaseArtifact cmdlet.
- Octopus Deploy template - The location is set on the Create Database Release step (Export path parameter).
- VSTS - You can access these if you are using a Private agent and you can set the location in the Export path parameter.
Check the logs/console output
At the default logging level you will not get enough information to pinpoint the exact cause, however you can increase the level of the log/console output.
- Powershell
At the start of your script add:
$DebugPreference = 'Continue'
$VerbosePreference = 'Continue'
- Octopus Deploy template
Edit the template and add the same variables listed above for Powershell
- VSTS
On your release definition, add a process variable named system.debug and set its value to true
Was this article helpful?
Articles in this section
- Method not found: 'System.Security.CodeAccessPermission'
- Couldn't connect to the database specified by the Target parameter: A connection was successfully established with the server, but then an error occurred during the login process
- Could not install SqlChangeAutomation from any registered PSRepository
- System.Exception: No match was found for the specified search criteria and module name 'SQLChangeAutomation'. Try Get-PSRepository to see all available registered module repositories
- No match was found for the specified search criteria and module name 'SqlChangeAutomation'.
- Online index operations can only be performed in Enterprise edition of SQL Server
- Unable to resolve package source
- error 5(Access is denied.) while attempting to open or create the physical file
- SQL Change Automation Installation freezes at 99%
- SQL Change Automation Powershell permissions