You can write an SSIS package that will complete all of these steps.
Create the variable myResult. View â Other windows â variables. Make sure that you are at the control flow level of the package, and not click on any task / step. You want this variable to cover the package level. Give it an Int32 data type and set the default value as the error code.
Run the SQL task, set the resultset property to "Single Row". Put the result in a variable with the result set area. Set the result name = 0 and the variable name = user :: myResult.
Verify the result by double-clicking the row between these two SQL tasks. Set to evaluate the expression and set the expression as follows: @myResult == 0
Run the following SQL task, putting the result in the same variable
Check the result as before
Perform package task (execute your SSIS)
Continue as needed ...
You can execute SSIS packages with DTEXEC.exe runtime . Return codes are listed here, so you can integrate into another process.
- Additional materials -
Since you want this to be common to many cases, you could write some code that pulled out the test case, as well as individual steps from the table, or you could do the same in SSIS (maybe!).
In SSIS, you can create a Foreach contour container that will work with the ADO result set stored in a variable. Depending on the type of step â SQLCMD or the SSIS package, you can branch to execute the package or execute the SQL statement using expressions to modify the relevant information, such as the package path or the sql statement. For simplicity, you will need a server field, sqlcmd and packagename for each step - the SQL task does not need the packagename command and ssis does not require sqlcmd.
Sam
source share