SSIS Resetting the ResultSet in Script Task

  • I have a package where I have a Execute SQL Task and then I take the output and put it into a variable. This is working fine. The problem is that in order to do this I must set the "ResultSet" property to "Single Row" THen Later when I execute the data flow process the file is being created but only with one row. I think this is happening because I set the Result set in the Control flow to Single row. Because When I preview what should be put into the file, I see over 100 records, But when it executes I only get one. Anybody have any ideas. I have googled this over and over and cannot find anything similar. This is driving me crazy

  • hi,

    I don't think that there is a dependency between control flow and data flow, since you are setting the property in the control flow, so that won't return only single record. There Might be only single record in the table for that criteria.

    I'm not sure whether my reply really assist you, but you can try it out!!

  • Thats what I thought as well. But When I execute the same QUery in Management Studio I get 140 rows.

  • For clarity, are you running a t-sql script outside of the dataflow, and a second copy within the dataflow? Do both produce the same resultset? You said that you are populating a variable with one resultset, what is the second resultset?

    Are you outputting to a text file? and which format?

  • yes I am running a t-sql script outside of the data flow and another in the dataflow. The first query only gives the total number of rows that the output file will contain and the second outputs the actual data that will be in the output file. So for example If I am going to write 200 rows the first result set returns 200 and the other actually returns the records. The output file is a flat file destination file.

  • Did you use the fixed width file type? Do you actually have more output, it just looks like one row?

    This is a common problem with using the fixed width file format.

    If you use the ragged right option, you will have the option of placing the row delimiter as the column delimiter on the final column to get your row.

  • Hi

    How to add multiple XML results set in SSIS. i tried to add through he UI. it is added also, but i am getting error that

    "

    [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_XML".

    "

    my sp is returning two XML result sets one is data and another is status. i need to capture both.

    How can do it?

    Sanjeev

  • Sanjay (1/1/2009)


    Hi

    How to add multiple XML results set in SSIS. i tried to add through he UI. it is added also, but i am getting error that

    ...

    Sanjeev

    Please explain the link between your post and the rest of this thread.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi if you want to put the results of an xml query into a text file do you have to do a little of hard code it, i build a Execute T-sql and i populate the results of the query in an XML Variable.

    After that i write the code in an EXECUTE SCRIPT where you can write the result set to a file.

    If you want more clues for this procedure just let mi know.

    😉

  • Hello Grasshopper,

    I really want to know the procedure that you are following to resolve this issue.

    Thanks in Advance.

    Regards

    Sanjay.

  • What if the data needs to go to a variable (to then be sent to a web service)?

    I'm having the same error: Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_XML".

    I'm using a TSQL query to return a recordset (store locations). Right now, I'm limiting the recordset to 10 records. The TSQL query parses and returns data in the "Build Query" window.

    I have the Result Set going into a variable of type Object, Result Name 0

Viewing 11 posts - 1 through 10 (of 10 total)

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