October 31, 2013 at 11:30 am
My execute sql task returns a "full result set" which I store in an Object objResults. I want a simple way to get the number of rows in objResults. How do I do it ? I want to use c# code to get that number.
I could load the whole objResults into a DataTable and get the numberOfRows with myDataTable.Rows.Count;, but that approach is obviously inefficient.
A bit of information about my code - An execute sql task simply puts all the records into a recordset, ADO i think. Then a script task reads it and loads it into a database. There is no data flow at all. All control flow tasks only - so row count transform will not work. Any simple C# code ?
November 8, 2013 at 8:40 am
I won't write the C# for you, but it's not too difficult. Google should be helpful in this situation.
Personally, unless you need to do other work in the Script Task, I would simply add a 2nd Execute SQL Task. Modify your 1st query to pull a count, and store the result in an SSIS variable.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy