Unix Technical Forum

rowcount help

This is a discussion on rowcount help within the SQL Server forums, part of the Microsoft SQL Server category; --> i'm trying to get total rows found by query that uses top clause... for example: select top 10 myTable.* ...


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-29-2008, 08:27 PM
D.B.
 
Posts: n/a
Default rowcount help

i'm trying to get total rows found by query that uses top clause...

for example:
select top 10 myTable.* from myTable where myTable.number > 200


let's say there are 13 rows matching that condition, and by using
@@rowcount my result would be: 10.


is there any way to get total row count, without affecting the TOP
clause??? i believe that the mysql equivalent would be
SQL_CALC_FOUND_ROWS().


tnx...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 08:27 PM
Dan Guzman
 
Posts: n/a
Default Re: rowcount help

I answered this question in microsoft.public.sqlserver.server.

It's bad etiquette to post the same question independently to multiple
groups because that causes unnecessary duplication of effort by persons
trying to help. If you have a question appropriate for multiple groups,
specify all groups in a single post so that all responses appear in all
groups.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"D.B." <dejan.bukovic@gmail.com> wrote in message
news:1148128056.678229.59640@i39g2000cwa.googlegro ups.com...
> i'm trying to get total rows found by query that uses top clause...
>
> for example:
> select top 10 myTable.* from myTable where myTable.number > 200
>
>
> let's say there are 13 rows matching that condition, and by using
> @@rowcount my result would be: 10.
>
>
> is there any way to get total row count, without affecting the TOP
> clause??? i believe that the mysql equivalent would be
> SQL_CALC_FOUND_ROWS().
>
>
> tnx...
>



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 07:16 AM.


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