Board index » delphi » Size of resultset

Size of resultset


2005-03-14 04:24:11 AM
delphi243
Is there anyway to find out the size of a result set that a query retrieves?
I am using SQL Server and although there is a stored procedure called
sp_spaceused which brings back the size of a table, this is not what I am
looking for as I need to know the amount of spaced used for the result set.
 
 

Re:Size of resultset

Pod writes:
Quote
Is there anyway to find out the size of a result set that a query retrieves?
I am using SQL Server and although there is a stored procedure called
sp_spaceused which brings back the size of a table, this is not what I am
looking for as I need to know the amount of spaced used for the result set.

ADO Field objects have ActualSize and DefinedSize properties,
so I imagine you can calculate the total size of a recordset by
iterating the fields to calculate the size of each record.
--
jc
Remove the -not from email
 

Re:Size of resultset

"Pod" <XXXX@XXXXX.COM>writes
Quote
Is there anyway to find out the size of a result
set that a query retrieves? I am using SQL
Server and although there is a stored procedure
called sp_spaceused which brings back the size
of a table, this is not what I am looking for as
I need to know the amount of spaced used for the
result set.
I could be wrong but it sounds like you want to
know the number of rows that will be returned
without actually reading through the result set.
If that is the case you can use "SELECT COUNT(*)
..." using the same WHERE clause. SQL Server
doesn't know the number of rows in a result set
until it actually finds them all.
- Arnie