Using variables in SSIS Script task
The objective of this task is to teach you how to work with SSIS variables in a Script task. You will learn two ways, a more complex one and a simpler one. You will typically use the latter in your packages.
Getting ready
There are no special prerequisites for this recipe, except, of course, SSIS 2016. In addition, you can use either your own text files for testing, or the three text files provided with the code for this chapter (Ch07_03.txt
, Ch07_08.txt
, and Ch07_10.txt
).
Note
For your convenience, the VB and C# code snippets needed for this chapter are provided in the Chapter07.txt
file.
How to do it...
- Open SQL Server Data Tools (SSDT) and create a new project using the Integration Services Project template. Place the solution in the
C:\SSIS2016Cookbook\Chapter07\Solution
folder and name the projectAdventureWorksETL
. - Rename the default package
UsingVariables.dtsx
. - Create a
intCounter
variable with data typeInt32
and a default value of0
. - Create a
strFile
variable...