Synopsis
Runs specified SQL scripts in the pipeline.
Description
The Execute step 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
To add the step, go to the Build Steps section in the settings of your project and click Add build step. Then in the drop-down list that appears, select dbForge DevOps Automation for SQL Server – Execute. After that, the user interface for the Execute step will be displayed.
Customization options
Build runner is a part of TeamCity that allows integration with a specific build tool. Select dbForge DevOps Automation for SQL Server - Build here.
Optional: Specify the step name to distinguish it from other steps.
Specify the step execution policy. Here you can select from the following options:
Always, even if build stop command was issued
Specify a path to a SQL or ZIP file with the script to execute or a folder with SQL or ZIP files. If a path refers to a folder, the scripts are executed in alphabetical order (subfolders are ignored).
Target database to execute
Server
Enter the name of the target server, e.g., SERVERNAME\INSTANCENAME.
Enter the name of the target database.
Select the authentication method to use: Windows authentication or SQL Server authentication.
Advanced options
Select the encoding to be used to open and execute the script.
Enter a password to the protected archive file.
Select to allow scripts execution to continue despite errors.