Unix Technical Forum

Fast counting of records

This is a discussion on Fast counting of records within the SQL Server forums, part of the Microsoft SQL Server category; --> I seem to remember reading many moons ago about a function where you can retrieve a count of the ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:52 PM
Samuel Hon
 
Posts: n/a
Default Fast counting of records

I seem to remember reading many moons ago about a function where you
can retrieve a count of the last recordset you opened.

For example:

I've got a stored procedure that returns a recordset using the TOP 10
so I only get the top 10 records. I need to know the recordcount but I
dont want to reuse the SELECT statement because its quite complex.

Any ideas?

What does @@Count do?

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:52 PM
Simon Hayes
 
Posts: n/a
Default Re: Fast counting of records


"Samuel Hon" <noreply@samuelhon.co.uk> wrote in message
news:c8672b7d.0309110815.2fba8c32@posting.google.c om...
> I seem to remember reading many moons ago about a function where you
> can retrieve a count of the last recordset you opened.
>
> For example:
>
> I've got a stored procedure that returns a recordset using the TOP 10
> so I only get the top 10 records. I need to know the recordcount but I
> dont want to reuse the SELECT statement because its quite complex.
>
> Any ideas?
>
> What does @@Count do?
>
> Thanks in advance


@@ROWCOUNT

Simon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com