INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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

Quote (SSIS)

[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)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close