I've seen some sample code on how to get a page of data from a large table using a stored procedure.
However, I need to be able to get a range of rows rather than a page. This sounds like the same thing, or maybe it is, however, the range of rows may or may not be based on the identity column. For example, if the client want the data sorted by last name, and it asks for rows 1 through 20, then identity won't work. I want the SP to be able to handle any table with the ability to know what column we are sorting by and what range of rows to return (based on the current sort). Does this make sense?
Any feedback would be appreciated.
The backgroung is - my client app is VC++ using OLE DB. I wrote what I thought was a good interface from the client to access the rows I wanted and display them in a virtual list control. I have been told that it is best to do as much programming in a Stored Procedure rather than on the client. So I am now in the redesign mode.
Thanks
However, I need to be able to get a range of rows rather than a page. This sounds like the same thing, or maybe it is, however, the range of rows may or may not be based on the identity column. For example, if the client want the data sorted by last name, and it asks for rows 1 through 20, then identity won't work. I want the SP to be able to handle any table with the ability to know what column we are sorting by and what range of rows to return (based on the current sort). Does this make sense?
Any feedback would be appreciated.
The backgroung is - my client app is VC++ using OLE DB. I wrote what I thought was a good interface from the client to access the rows I wanted and display them in a virtual list control. I have been told that it is best to do as much programming in a Stored Procedure rather than on the client. So I am now in the redesign mode.
Thanks