![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Select count(*) as record_count from table1 Have the above sql in a sql task it maps the output to a variable called "record_count" which is set up to be scoped to the package. After the select occurs I am trying to set a precedence constraint based on whether the count result is greater than zero. my expression is simple... @record_count > 0 trouble is that when the sql task executes it will not set the record count value in the variable. the sql task fails trying to set the variable. Error: 0xC002F309 at Execute SQL Task, Execute SQL Task: An error occurred while assigning a value to variable "record_count": "The type of the value being assigned to variable "User::record_count" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. THe above error is when the varaible is int16 datatype. The record count is natively INT. If I cast the record count to be varchar and then change the variable to string it works. If I convert it to string then my expression must then cast the variable to an INT to test the value. I then do (DT_I4)@record_count 0 but I get errors saying it wont convert the value. TIA |
![]() |
| Thread Tools | |
| Display Modes | |
| |