Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language
CREATE TABLE #tab(id INT); DECLARE @i INT = 0; WHILE @i < 1000 BEGIN INSERT INTO #tab VALUES (@i); SET @i += 1; END DECLARE @PageSize BIGINT = 10; DECLARE @PageNumber BIGINT = 1; DECLARE @SkipRows INT = @PageSize * (@PageNumber - 1) SELECT * FROM #tab ORDER BY id OFFSET @SkipRows ROWS FETCH NEXT @PageSize ROWS ONLY --COALESCE(@take,0x7ffffff)