Thursday, April 22, 2010

Script to loop through or print variables in SSIS script

bool t = true;


int i = 0;

int c = Dts.Variables.Count;

Dts.Events.FireInformation(99, "Count", Convert.ToString(c ), "", 0, ref t);

while (i < c )

{

Dts.Events.FireInformation(99, Dts.Variables[i].QualifiedName, Convert.ToString(Dts.Variables[i].Value), "", 0, ref t);

i++;

}

Note that this will print only the variables that have been selected in the "ReadOnlyVariables" option of the script task.

No comments:

Post a Comment