Monday, November 23, 2015

SSIS Control Flow Templates in 2016 CPT3.0

SSIS CTP3.0 introduces control flow templates. The templates allow you to define a control flow task and re-use it across multiple packages.

For this post, we will create a template that logs package completion to a database and sends an email out.

Creating Control Flow Template.
In SSDT a new folder called Control Flow Templates has been added. To create a new control flow template – right click on the folder and select “New Control Flow Template”.
The control flow template looks like SSIS package with .dtsxt extension.



For this example template, create a sequence container with two tasks – Execute SQL Task for logging and Script task for sending email out.




Using Control Flow Template.
To use the template, drag the template from the SSIS tool bar to the control flow task in the package.




Configuring Control Flow Template.
To configure the template, double click on the template, you can configure the properties or connections of the template. For the current version (CTP3.0), you can only manually set the properties. The configuration dialog doesn’t accept any expressions or parameters.






Notes
Templates is a design time feature. When a package containing template instance is saved, the SSIS designer replaces the template instance with contents from the corresponding template (dtsxt) file. The SSIS runtime is not aware of templates.

Limitations
The biggest limitation (As of CTP3.0) is that - Template Configuration dialog does not take expressions/parameters/variables. You can only set the values manually.
The template cannot access project parameters and doesn’t have parameters of its own, that make configuring templates difficult.
You can have only one control flow task in template, if you need multiple put them in a sequence container.

No comments: