Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSIS : varaible mapping ForEach loop

Status
Not open for further replies.

p27br

Programmer
Aug 13, 2001
516
GB
hello,

i am getting the following errors in my SSIS Package :

Code:
Error: ForEach Varaible Mapping 3 to variable "myVariable" cannot be applied.

and

Code:
Error: The type of the value being assigned to variable "myvariable" differs from the current variable type. Varaibles may not change during execution...

This error happens with all my package variables with DataType = Double.

My package is composed by a Data Flow Task which loads a SQL Statement into a recordset, and a ForEach Loop which loops through the recordset.
I mapped the package variables to the recordset fields. When the package tries to execute the ForEach loop, it runs into the conversion errors.

The recordset fields come from float type fields in a SQL database. If I look in the Advanced editor for Recordset destination, I see the fields have a datatype of DT_NUMERIC ! But the values are float (e.g. 2541.3) so I think the recordet task is not detecting the correct type.

I hope I have been clear enough.
any help much appreciated

:)
 
ok

i have found that if i open the advanced editor for the OLE DB source, I can change the DT_NUMERIC type to float in the output columns node
it seems to work now, but I don't know if it may have unforeseen consequences.
i still don't understand why it detects float values as DT_NUMERIC in the first place
 
i also found that if i forced the conversion to float in the SQL statement , then the type will be correct in the package.


is there no "edit post" functionality ?
is there an SSIS forum ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top