This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
The first group of towels is set aside while the remaining sequence stays on its shelf

How to Skip Top N Rows in SQL Server? – Interview Question of the Week #237

August 11, 2019
Pinal Dave
SQL Interview Questions and Answers
Ranking Functions, SQL Function, SQL Paging, SQL Scripts, SQL Server

Question: How to skip top N Rows in SQL Server and retrieve the rest of the rows? Answer: I had asked the above question in one of the interviews last week.

Read More
Gouache painting of a shelf of sorted pears with the first three covered and the next four in a vermilion basket

OFFSET FETCH in SQL Server: Get Rows 21 to 30 After ORDER BY

August 6, 2019
Pinal Dave
SQL Tips and Tricks
SQL Order By, SQL Paging, SQL Scripts, SQL Server

OFFSET FETCH reads a block of rows from the middle of a sorted result. The demo returns rows 21 to 30, builds pages from a page number and measures why deep pages cost more. A seek based alternative reads the same two pages every time.

Read More
One group of cards is raised from the middle of an ordered index-card tray

How to do Pagination in SQL Server? – Interview Question of the Week #111

February 26, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Paging, SQL Scripts, SQL Server

How do you do pagination in SQL Server? A popular interview question. Instead of pulling every row into the app, here is a method that returns just one page.

Read More
SalesOrderDetail' table.

SQL SERVER – Tricks for Row Offset and Paging in Various Versions of SQL Server

April 14, 2013
Pinal Dave
SQL Tips and Tricks
SQL Paging

Paging is needed in almost every application. I show row offset and paging scripts for each version from SQL Server 2000 to 2012, using AdventureWorks.

Read More
A socket wrench sitting slightly loose on a hex bolt, a nearly identical socket from another set lying beside it

Where T-SQL Differs From the ANSI Standard

March 31, 2013
Pinal Dave
SQL Tips and Tricks
Developer, SQL NULL, SQL Paging, SQL Server, SQL String

See where T-SQL differs from the ANSI standard in row limits, concatenation, NULL behavior, and practical query portability.

Read More
Hands feeding a long knotted rope into harbor water, a red rag tied at a knot far down the line

OFFSET FETCH Paging and Its Deep Page Problem

April 5, 2011
Pinal Dave
SQL Performance
SQL Order By, SQL Paging, SQL Performance, SQL Server

Use OFFSET FETCH with a unique sort order, compare early and deep page reads, and decide when a cursor based approach fits better.

Read More
SQL Server query window.

SQL SERVER – Server Side Paging in SQL Server Denali – Part2

December 26, 2010
Pinal Dave
SQL Performance
SQL Paging, SQL Scripts

Part 2 of server side paging in SQL Server Denali: a reader keeps rows per page and page number in a table, and OFFSET and FETCH can read them from there.

Read More
1 2 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com