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
Oct29

A Daily Streak in SQL: Finding the Longest Run of Consecutive Days

Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL DateTime, SQL Scripts, SQL Server
No Comments

Find consecutive days with gaps and islands, rank the longest streak per user, and define a current streak using the right business date.

Continue Reading
Oct28

Get the Second Row From a Table in SQL Server

Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Scripts, Temp Table
10 Comments

To get the second row from a table, first decide what second means, because a table has no order until you give it one. This post builds a small demo and compares ROW_NUMBER, OFFSET and FETCH, and TOP inside TOP. It also covers every second row, the second row in each group, ties and the cost of each method.

Continue Reading
Oct27

Why Query Store Actual Operation Mode is Not Same as Requested? – Interview Question of the Week #248

Pinal Dave
SQL Interview Questions and Answers
Query Store, SQL Scripts, SQL Server, SQL Server Configuration
1 Comment

Question: Why Query Store Actual Operation Mode is Not Same as Requested? Query Regression (poor performing queries, once working great)

Continue Reading
Oct26

Session Wait Stats: Find the Query Behind a Wait Type

Pinal Dave
SQL Performance
SQL DMV, SQL Scripts, SQL Server, SQL Wait Stats
2 Comments

Session wait stats tell you which session produced a wait type, and the input buffer tells you which query that session ran. This post shows how to see who waits right now, how to read the wait history of each session, and how to join them to the query text. It also explains the THREADPOOL wait.

Continue Reading
Oct25

No Custom Security Extensions: SQL Server Upgrade Rule Failure

Pinal Dave
SQL Tips and Tricks
Reporting Services, SQL Error Messages, SQL Server, SQL Upgrade
1 Comment

The No Custom Security Extensions rule failure stopped a SQL Server upgrade because Reporting Services had custom extensions configured. The fix that worked was to clear the extensions in RSReportServer.config, upgrade, and put them back afterward.

Continue Reading
Oct24

Parallel Plans: Reading Gather Streams and Repartition Streams

Pinal Dave
SQL Performance
Execution Plan, MAXDOP, Parallel, SQL Performance, SQL Server
No Comments

Read Gather Streams and other parallel exchanges, inspect rows per thread and spill evidence, and relate exchange waits to actual work.

Continue Reading
Oct23

Does GROUP BY Sort Results? Only ORDER BY Guarantees It

Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Group By, SQL Order By, SQL Scripts
3 Comments

Does GROUP BY sort the rows it returns? No: only ORDER BY guarantees an order. This post builds a small demo, shows one GROUP BY query returning two different orders, and reads the plans that explain why.

Continue Reading
Previous 1 … 142 143 144 145 146 147 148 … 846 Next

SQL Server slow? Let's fix it together in about four hours.

Pinal Dave

In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.

You keep every script, and the know-how to fix it yourself next time.

Want your whole team to learn it?

My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.

Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.


Who We Are

Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.

Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.

Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).


Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.


Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

  • Books
  • Testimonials
  • Privacy Policy

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