title: Efficient way of getting @@rowcount from a query using row_number
body: <p>I have an expensive query using the row_number over() functionality in SQL Server 2005.  I return only a sub list of those records as the query is paginated.  However, I would like to also return the total number of records, not just the paginated subset.  Running the query effectively twice to get the count is out of the question.</p>
  
  <p>Selecting count(*) is also out of the question as the performance is absolutely terrible when I've tried this.</p>
  
  <p>What I'd really love is @@ROW_NUMBERROWCOUNT :-)</p>