user3633601
user3633601

Reputation: 21

Insert two variables to object in SSIS

ALL,

I am trying to store the value of two variables:

Variable1Value:    2014-05-10 00:00:00.000
Variable2Value:    2014-05-08 00:00:00.000

Into an Object type variable so that I loop it with a FOREACH LOOP in SSIS but, I don't know how to do it.

Normally with a OLE DB connection, I would create a variable of type object and stored my result set there, but with an ODBC connection, that's not the case, because the step always fails.

Can somebody help me.

Thank you

Upvotes: 2

Views: 1286

Answers (1)

Mike Honey
Mike Honey

Reputation: 15027

I would replace the Execute SQL Task with a Data Flow Task. Inside that, I would start with an ODBC Source component with your ODBC SQL statement. Then I would connect that to a Recordset Destination, and configure that for the Object type Variable.

This design also exposes the SSIS Data Types of the returned columns (e.g. in the Recordset Destination), avoiding guesswork when you come to use them downstream.

Upvotes: 3

Related Questions