The Script Task: Scripting through Control Flow
The first, and most easy-to-use scripting component in SSIS is a Script Task during Control Flow, which works with .NET scripts in both C# and VB.NET, which can be written inside the Script Task with its own scripting editor.
Besides the fact that SSIS has a complete and fully functional series of Control Flow Tasks, there are times when some requirements cannot be fulfilled with built-in Control Flow Tasks; this is when the Script Task comes into play.
In this recipe, we will use a simple example to demonstrate how the Script Task works. The Send Mail Control Flow Task has a few limitations; for example, if you want to send an e-mail in HTML with special formatting, you cannot use the Send Mail Task. In this recipe, we will implement such functionality with a Script Task and C# code.
How to do it...
Create a new SSIS project and name it
R01_ScriptTask
.Create a package variable of type
String
and name itReceiver
; in the default value field write...