Home All Groups Group Topic Archive Search About

Way to see how many records will be returned?

Author
14 Jul 2005 8:49 PM
ChrisR
sql2k

I could have sworn there was a way to see how many records will be returned
from a query in Query Analyzer. Either under "Query" or "Tools"? Ive tried
and cant find it. Is there such a thing?

TIA, ChrisR

Author
14 Jul 2005 8:53 PM
Hari Prasad
Hi,

The count will differ based on your Where condition. So the oly way to get
the count of records is by executing the Select statement.

Thanks
Hari
SQL Server MVP



Show quote
"ChrisR" <noem***@bla.com> wrote in message
news:%23yTjKWLiFHA.3492@TK2MSFTNGP10.phx.gbl...
> sql2k
>
> I could have sworn there was a way to see how many records will be
> returned from a query in Query Analyzer. Either under "Query" or "Tools"?
> Ive tried and cant find it. Is there such a thing?
>
> TIA, ChrisR
>
Author
14 Jul 2005 9:58 PM
JT
Within Query Analyzer, type or paste your SQL query and then select the menu
option Query.. Display Estimated Execution Plan. Move your mouse over the
icons within the graphical execution plan and you will see estimated row
count, extimated I/O and CPU costs, indexes used, and other useful
information. Depending on complexity of the query and the amount of data, it
may still take a while to run.

Show quote
"ChrisR" <noem***@bla.com> wrote in message
news:%23yTjKWLiFHA.3492@TK2MSFTNGP10.phx.gbl...
> sql2k
>
> I could have sworn there was a way to see how many records will be
returned
> from a query in Query Analyzer. Either under "Query" or "Tools"? Ive tried
> and cant find it. Is there such a thing?
>
> TIA, ChrisR
>
>
Author
15 Jul 2005 11:17 PM
ML
Maybe if you run:

select count(*)
  from ... <the rest of the query here> ...

....before actually running the 'real' query.


ML

AddThis Social Bookmark Button