The SQL Statement Task Type is used for executing SQL directly on a connection. Currently the SQL Statement task can only be used with SQL Server connections, supporting T-SQL syntax validation.
SQL Statements can be provided directly in-task using the statement editor provided, or the path to a
.sql file can be used in place of the statement. Either way, this statement can be “verified” for any syntactic issues using the “Verify SQL Statement”
button located underneath the task.
SQL Statement Verification may sometimes fail if working with entities that do not exist yet. Verification is not required so it is possible that completely valid SQL may result in a failed verification due to conditions outside of the statement.
SQL Statements support parameters which can be used to provide variables that can be modified at a job sequence level. This means you could have the same SQL Statement task with different results and effects depending on what parameter is provided.
Parameters can be referenced in script using the T-SQL local variable syntax of
Parameter values need to be set when the task is added to a job’s sequence. Learn more about parameters in the jobs documentation.
|Param Name||Param Value||Script||Formatted Script|
To learn how to use a File Connection as your Script Source to execute a script in a file in your Git Repository, please read more here.