I am using SQL Server 2005 Business Intelligence Studio and struggling with returning an integer value from a very simple execute SQL Task. For a very simple test, I wrote the SQL Statement as:
Select 35 As 'TotalRecords'
Then, I specified ResultSet as
ResultName = TotalRecords and
VariableName = User::TotalRecords
When I execute this, the statement is executed but the variable doesn't have the updated value. However, it has the default value that I specified while variable definition.
The return of a date variable works, but integer variable isn't working. The type of User::TotalRecords
specified is Int32 in a package scope.
Thanks for any hints
The value for Result Name is incorrect. Try using an ordinal (position) based approach.
A basic set up for an OLE or ADO.NET Execute SQL Task
Here I have specified the ordinal of 0 for the zeroeth column in my resultset.
Here you can see the original variables and their values (-1, -2) as well as their run-time values of 35 for both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With