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.
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
).
- 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...