Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return Integer value from SSIS execute SQL Task

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

like image 407
Bokhari Avatar asked Dec 20 '22 16:12

Bokhari


1 Answers

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

enter image description here

Here I have specified the ordinal of 0 for the zeroeth column in my resultset.

enter image description here

Here you can see the original variables and their values (-1, -2) as well as their run-time values of 35 for both.

enter image description here

like image 62
billinkc Avatar answered Dec 28 '22 08:12

billinkc