Return Value for Execute SQL Task

  • I have an Execute SQL Task that contains a cursor loop sql. At the end of the sql, I have a variable with the number of rows I have inserted from my cursor loop.

    In the code, I have specified RETURN @RowCount. I have tried both Result Set and Output Parameters to populate my variable, neither which have worked. I am not sure how I handle the varible in the sql so that the task can recongnize it and pick it up.

  • You'd be wise not to mention the 'c' word in this forum 🙂

    Have you tried SELECT ... rather than RETURN?


  • I figured this one out. I put the following line of sql at the end of my code, and did a result set looking for the RowCnt and populating my Count variable in SSIS.

    SELECT @RowCount AS RowCnt

  • Stringzz (2/1/2011)


    I figured this one out. I put the following line of sql at the end of my code, and did a result set looking for the RowCnt and populating my Count variable in SSIS.

    SELECT @RowCount AS RowCnt

    You figured it out?


  • Thanks Phil, I actually had a lightbulb go off before I saw your post, but you would have directed to the correct solution if I hadn't figured it out.

  • Stringzz (2/1/2011)


    Thanks Phil, I actually had a lightbulb go off before I saw your post, but you would have directed to the correct solution if I hadn't figured it out.

    Haha, good stuff. I've been up for hours & coming to the end of a big upgrade for a client, so I'm slightly edgy 🙂


Viewing 6 posts - 1 through 5 (of 5 total)

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