sql - Efficient way of getting @@rowcount from a query using row_number -


I have an expensive query using the line_number over () functionality in SQL_server 2005. I have endorsed the query as only a sub list of those records. However, I would not even want to return the total number of records, not only the paged subset. To count the question twice is effectively out of the question.

Selection of the count (*) is also out of the question because the performance is terrible when I tried to do it.

What I really like @@ ROW_NUMBERROWCOUNT: -)

COUNT Check (*) when used with over (PARTITON BY ..), same:

  as ROWNum (order by object_id, column_id), COUNT (*) over (Part) 1) TotalRows, * master.sys.column from  

This is the best way to do this without the IMHO two questions.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -