Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Pagination In Sql

--CREATING A PAGING WITH OFFSET and FETCH clauses IN "SQL SERVER 2012"
DECLARE @PageNumber AS INT, @RowspPage AS INT
SET @PageNumber = 2
SET @RowspPage = 10 
SELECT ID_EXAMPLE, NM_EXAMPLE, DT_CREATE
FROM TB_EXAMPLE
ORDER BY ID_EXAMPLE
OFFSET ((@PageNumber - 1) * @RowspPage) ROWS
FETCH NEXT @RowspPage ROWS ONLY;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Pagination #In #Sql
ADD COMMENT
Topic
Name
7+2 =