Hi,
I have recently written some stored procedures in sql server and I have run into the following problem for which I cannot find any solution .
Here is the scenario:
I have a table of 100 tickets. the status of a ticket can be open/closed/canceled. It is the duty of 5 people (say A,B,C,D,E) to constantly deal with the tickets.
Person A jumps to page 5 (showing 20 open tickets at a time) and is working on 1st ticket. In the meantime, the rest 4 people, close all the other tickets on page 5. When person A closes the ticket and returns back on page 5, he sees no rows ..
I have written my sql query in the fashion shown in except that my SELECT statement inside the {} of WITH statement is complicated.
The behavior that I want is that if the stored procedure is passed @pageNum = 5, and there are only 3 pages of records left then it should return the last page (3rd page) with however many records(0-20) are on that page.
I have not been able to find any solutions on the web and even in this forum regarding this. any help will be appreciated
thx
moskhan2
I have recently written some stored procedures in sql server and I have run into the following problem for which I cannot find any solution .
Here is the scenario:
I have a table of 100 tickets. the status of a ticket can be open/closed/canceled. It is the duty of 5 people (say A,B,C,D,E) to constantly deal with the tickets.
Person A jumps to page 5 (showing 20 open tickets at a time) and is working on 1st ticket. In the meantime, the rest 4 people, close all the other tickets on page 5. When person A closes the ticket and returns back on page 5, he sees no rows ..
I have written my sql query in the fashion shown in except that my SELECT statement inside the {} of WITH statement is complicated.
The behavior that I want is that if the stored procedure is passed @pageNum = 5, and there are only 3 pages of records left then it should return the last page (3rd page) with however many records(0-20) are on that page.
I have not been able to find any solutions on the web and even in this forum regarding this. any help will be appreciated
thx
moskhan2