The returned integer value from SSIS performs an SQL task

I am using SQL Server 2005 Business Intelligence Studio and struggling with integer return from a very simple SQL execution task. For a very simple test, I wrote an SQL statement like:

Select 35 As 'TotalRecords' 

Then I set the ResultSet as

 ResultName = TotalRecords and VariableName = User::TotalRecords 

When I execute this, the statement is executed, but the variable has no updated value. However, it has a default value that I set when defining the variable.

Returning a date variable works, but an integer variable does not work. The type of the specified User::TotalRecords is Int32 in the package area.

Thanks for any tips.

+4
source share
2 answers

The value for the result name is invalid. Try using the ordinal (positional) approach.

Basic setup for OLE or ADO.NET SQL task execution

enter image description here

Here I have indicated serial number 0 for a column with a null value in my result set.

enter image description here

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

enter image description here

+11
source

Once your package completes the yuor variables, return to the default state. If you use a breakpoint or msgbox, you will see that at runtime your variable matters.

0
source

Source: https://habr.com/ru/post/1435931/


All Articles