sqldba_newbie (2/16/2013)
This is more of generic programming question. We have a stored procedure which is used on many of our applications built using asp.net. The sp basically first gives total count of pages and then displays the records. I would like to NOT include the count in the sp because it is most expensive ( very bad design, i will tried my best to optimize didnt find much luck). Is there any other way this can be calculated like in asp.net or somewhere else?
Please post the actual plan for the stored procedure.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden