http://yugalpandya.wordpress.com/2013/09/30/custom-paging-user-control-for-large-amount-of-data-in-gridview/
Showing posts with label paging. Show all posts
Showing posts with label paging. Show all posts
Saturday, August 16, 2014
Saturday, May 31, 2014
SQL SERVER SELECT USING PAGING DATA
begin
DECLARE @intPage INT =4
DECLARE @intPageSize INT =20
DECLARE @intStartRow int;
DECLARE @intEndRow int;
SET @intStartRow = (@intPage -1) * @intPageSize + 1;
SET @intEndRow = @intPage * @intPageSize;
WITH blogs AS
(SELECT USER_FULL_NAME,
ROW_NUMBER() OVER(ORDER BY USER_ID DESC) as intRow,
COUNT(USER_ID) OVER() AS intTotalHits
FROM USERS)
SELECT USER_FULL_NAME, intTotalHits FROM blogs
WHERE intRow BETWEEN @intStartRow AND @intEndRow
end
DECLARE @intPage INT =4
DECLARE @intPageSize INT =20
DECLARE @intStartRow int;
DECLARE @intEndRow int;
SET @intStartRow = (@intPage -1) * @intPageSize + 1;
SET @intEndRow = @intPage * @intPageSize;
WITH blogs AS
(SELECT USER_FULL_NAME,
ROW_NUMBER() OVER(ORDER BY USER_ID DESC) as intRow,
COUNT(USER_ID) OVER() AS intTotalHits
FROM USERS)
SELECT USER_FULL_NAME, intTotalHits FROM blogs
WHERE intRow BETWEEN @intStartRow AND @intEndRow
end
Subscribe to:
Posts (Atom)