Passing parameters to migration scripts
EricLamontagne
Posts: 46 Bronze 3
Hi,
My understanding is that SCA uses sqlcmd to execute the migrations scripts.
In these migrations scripts, there is a parameter (variable) $DatabaseName.
Is there a way for me to have my own set of parameters/variables that I would pass from my powershell script to the migration script?
Regards,
Eric Lamontagne
Best Answer
-
Ivo_Miller Posts: 31 Silver 3Hi,
For deployment, if you are using the PowerShell cmdlets directly, see example 6 here: https://documentation.red-gate.com/sca/reference/powershell-cmdlets/new-databasereleaseartifact
If you are using the SQL Change Automation release plugin for Azure DevOps or the SQL Change Automation step templates for Octopus deploy, any environment variables you define will automatically be passed in as SQLCmd variables.
All the best,
Ivo MillerIvo Miller
RedGate Software Developer
Answers
Yes, please see https://documentation.red-gate.com/sca/developing-databases/concepts/advanced-concepts/variables for more information regarding this.
Kind Regards,
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools