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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting from Recordset through Execute SQL Task in a For Each Loop Containers - Variables woes

Status
Not open for further replies.

TheBugSlayer

Programmer
Sep 22, 2002
887
0
0
US
Hi all.
I have a dataflow task that contains an OLE DB Source connected to a Recordset Destination. There is a variable of type Object which contains the recordset. It works fine.

The Data Flow Task connects to a Foreach Loop Container, which contains an Execute SQL Task, which in turn should insert the rows from the recordset into a table one by one. My problem is that I do not now how to pass the field names returned by Dataflow's OLE DB Source, which are mapped to corresponding variables in the Recordset Destination to the query. I have some thing like
Code:
insert into testtable(testvalue) values(?)

insert into testtable(testvalue) values(0)

and it does not work. The message I get is
SSIS said:
[Execute SQL Task] Error: Executing the query "insert into testtable(testvalue) values(?)" failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

What is the proper way of passing those variables to the query?

Thanks.

MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top