SSIS Row Count Variable information in a Email Script Task

885 views Asked by At

I am trying to get the Row count variable information which is there in a Data flow task to the Script task in the same package with no luck.

I have given the row count as an integer and declared at the package level so that i can call in the Script task but there is an error throwing when declaring the variable, below is the example

dts.variable("rownumercount").value

i also tried to convert this to string,

dim ncr as string = convert.tostring(dts.variable("rownumercount").value)

can any one please help, as i'm trying this to get the number if inserted records in a automatic email.

1

There are 1 answers

0
Jeroen Bolle On

I see a couple of possible flaws in your example:

  1. Variables are only available in your script when they are added to the ReadOnlyVariables or ReadWriteVariables properties of the Script Task.
  2. The collection containing variables is called Variables, not Variable. Meaning that the correct syntax is Dts.Variables("name_of_the_variable") in VB.NET.
  3. Check your spelling. Is your variable really called rownumercount, or is it actually the correctly spelled rownumBercount.
  4. User variables are normally prefixed with User::. Try the following syntax: Dts.Variables("User::rownumbercount").Value.