Synopsis
Runs specified SQL scripts in the pipeline.
Description
The Execute task allows for the flexible execution of SQL scripts, which can be used for a variety of purposes, such as to create a new database from custom scripts, execute migration scripts to update an existing database, or add unit tests for an already deployed database.
How to create the Execute task
If you need to update the database with migration scripts, use the dbForge DevOps Automation for SQL Server – Execute task. When configuring the task, specify the folder that stores the update scripts:
After execution, view the log to verify that everything was configured correctly:
Customization options
Source
Input
Enter a path to n SQL or ZIP file with the script to execute or a folder with SQL or ZIP files.
Enter the encoding to be applied to open and execute the script.
Enter the password to the protected archive.
Select to continue executing scripts in the folder despite errors.
Target
SQL Server
Enter target database server. E.g. SERVERNAME\INSTANCENAME. For local default instance use ‘(local).’
Enter the target database name.
Select the Authentication method, either SQL Server authentication or Windows authentication.
Enter the login name to use for SQL Server authentication.
Enter the password to use for SQL Server authentication.
Control Options
Select to enable the task in your pipeline. If a task is disabled, it will be skipped during the pipeline execution.
Select to continue the pipeline running even if this task fails.
Specify the number of retries for this task that will happen in case of task failure.
Note
This requires agent version 2.194.0 or later. Not supported for agentless tasks.
Specify the maximum time, in minutes, that a task is allowed to execute before being canceled by server. A zero value indicates an infinite timeout.
Specify when this task should run. Choose Custom conditions to specify more complex conditions.
Here you can select from the following options:
Output Variables
Any changes to the reference name will require updates to downstream tasks that uses this reference name, a valid reference name can only contain ‘a-z’, ‘A-Z’, ‘0-9’ and ‘_’.