Reading project parameters in Script Task

ssis, ssis-2012

Solution

So close. ;)

Your code is trying to access a variable/parameter named `Project::MaxRowsPerPull`

In fact, the $ is significant so you need to reference `$Project::MaxRowsPerPull`

Also note that you have the data type for the parameter as Int32 but are then pushing it into Int64. You can always put a smaller type into a larger container but if you tried to fill the parameter with too large a value your package will asplode.

Problem

This is what I'm trying to do in a script task: ``` long lngMaxRowsToPull = Convert.ToInt64(Dts.Variables["Project::MaxRowsPerPull"].Value); ``` I get an error message that the variable does not exist. Yet Its defined as a ReadOnlyVariable to the script and it does exist as a project parameter.

Original source