I am trying to build a query which will do this:
Lets say for example I have 100 records in the table. I have .net form which calls the query. I have a querystring parameter pageindex, something like http://mysite.com?id=2.
What I want to do now is if id = NULL, then get the 1st set of records from that table whichave id of 1 to 20, means from 1 to 20, if id=2 then get the 2nd set of recordw, from row 20 to 40, if id=3 then get the 3rd set of records, meaning records from 40 to 60, from that table.
I want to know if this is possible.
Thanks a lot in advance, Laziale
I am trying to build a query which will do this: Lets say for
Share
If you make it as you say so, and the IDs are in line from 1 to 100 you can do
@Page is the page number (base on 0)
If you wish to use the paging style of Ms SQL and the ids are not in line you can do
Reference :
http://msdn.microsoft.com/en-us/library/ms186734.aspx
http://msdn.microsoft.com/en-us/library/ms175972.aspx