Methods of putting SQL query into a recordset for looping purposes

  • What is the difference between:

    1. Using a Data Flow task with a SQL data source (OLEDB / ADONET) going into a Recordset destination represented by an Object (table) variable, that can then be looped through.

    2. Using an Execute SQL task that returns a Full Resultset with the Resultset property configured to go into an Object (table) variable, that can then be looped through.

    I've always done it using method #1. Today I was looking at a DTSX file for informational purposes (i.e. learning purpose), and noticed that in this scenario, the developer used method #2.

    Now that I think about the two methods, #2 seems clearly like the simpler, easier choice. Not sure I ever realized that one could accomplish "both" of these steps by simply utilizing the Resultset property window of the Execute SQL task. Thinking about this, now I'm also unsure why anyone (frankly it was probably a "SQL expert" on one of these sites) would have ever taught me to do it using method #1, which seems like a much longer way around....

    Thoughts, advice?

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply