I have a simple Select Statement that returns a single row. I am trying to read that value into a Package Level Variable and then use that variable in the next step.
Each time I run the package, I get the value -1 returned. Details of what I am trying to do is as follows:
SQL Statement: Select (Max(LoadNumber) + 1) As LoadNumber From TableName
Variable Name: User::LoadNumber, Datatype Int32
Execute SQL Task Details:
- ResultSet: SingleRow
- ConnectionType: OLEDB
On the Result Set Tab:
- ResultName: LoadNumber
- Variable Name: User::LoadNumber
I have a Script Task after this task to show a Messagebox with the value of the Variable and it shows -1
When I run the statement in a Query window, it shows the correct value.
Does anyone know why I could be getting -1? Seems like some type of returncode to me but I can't find from what?