Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Resultset Size Expand / Collapse
Author
Message
Posted Friday, June 06, 2008 6:09 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, August 28, 2011 2:21 AM
Points: 67, Visits: 56
I have t-sql query, in which I do some transactions and return a result set. After I execute the query, I need the size of resultset. The resultset may vary from execution to execution.
How to calculate the size of resultset?

Thanks in advance.
Post #512815
Posted Friday, June 06, 2008 6:16 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, March 26, 2013 9:55 AM
Points: 1,024, Visits: 2,768
Do you mean the number of rows returned?

Gethyn Ellis

gethynellis.com
Post #512823
Posted Friday, June 06, 2008 6:18 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, August 28, 2011 2:21 AM
Points: 67, Visits: 56
I don't need number of rows, but I need the size of data in all rows in KB / MB.

Post #512825
Posted Friday, June 06, 2008 6:46 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, March 26, 2013 9:55 AM
Points: 1,024, Visits: 2,768
don't know if there is an easy way of doing that other than summing the size of the data types of all rows returned and then multiplying that by the no of rows returned.

Gethyn Ellis

gethynellis.com
Post #512847
Posted Wednesday, July 16, 2008 4:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 30, 2012 9:48 AM
Points: 2, Visits: 40
I need to check the number of rows in a result set returned by a query in execute SQL task and execute different tasks based on the number of rows. Please let me know the steps for doing this.


Thanks
Post #535064
Posted Thursday, July 17, 2008 6:54 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 6:29 AM
Points: 2,551, Visits: 18,885
bnarav (7/16/2008)
I need to check the number of rows in a result set returned by a query in execute SQL task and execute different tasks based on the number of rows. Please let me know the steps for doing this.


Thanks


check out @@rowcount in the BOL.


---------------------------------------------------------
How best to post your question
How to post performance problems
Tally Table:What it is and how it replaces a loop

"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
Post #535929
Posted Thursday, December 16, 2010 7:16 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, March 27, 2013 8:55 AM
Points: 289, Visits: 683
Is there a way to do this, calculate the size of the resultset in kb/mb
Post #1035821
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse