Using Stored Procedure Managing Pagination
CREATE PROCEDURE SPName
@PageNum int,
@PageSize int
AS
BEGIN
SET NOCOUNT ON;
WITH OrdersRN
AS
(
SELECT ROW_NUMBER() OVER(ORDER BY createdatetime desc) AS RowNum ,NewsId,Title,createdatetime
FROM bdl_news
)
SELECT * FROM OrdersRN WHERE RowNum BETWEEN ((@PageNum - 1) * @PageSize + 1 ) AND (@PageNum * @PageSize ) ORDER BY createdatetime desc
end
ஏஞ்சல்
என்னை பற்றி
Google reader
Categories
- .Net (9)
- .Net Crystal Report (1)
- .Net GridView (3)
- Articles (5)
- Log File .Net (1)
- Sharepoint (2)
- Sitefinity 3.7 (3)
- SQL (5)
- Technical Question and Ans (3)
- Validation (1)
- XML (2)
Friday, September 11, 2009
SQL Paging
When hearts listen
angel sing.If you seek an angel with an open heart...
You shall always find loved one