Skip to content

Instantly share code, notes, and snippets.

@jorgevilaca82
Created April 8, 2017 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgevilaca82/074340227bb0608b2186b53ebd90fa15 to your computer and use it in GitHub Desktop.
Save jorgevilaca82/074340227bb0608b2186b53ebd90fa15 to your computer and use it in GitHub Desktop.
Páginação SQL Server
SELECT * FROM Tabela
ORDER BY (SELECT NULL)
OFFSET 3 ROWS FETCH NEXT 1 ROWS ONLY;
-- numero de registros por página
declare @PERPAGE int = 1;
select ((select count(*) from sala) / @PERPAGE) as QTD_PAG;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment