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
A colorful paper chain along a kitchen window with one gap in the loops, scissors on the sill

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

October 29, 2019
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL DateTime, SQL Scripts, SQL Server

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

Read More
Gouache painting of five matching tea cups in a row with the second from the left in vermilion

Get the Second Row From a Table in SQL Server

October 28, 2019
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Scripts, Temp Table

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.

Read More
A cabinet's contents are visible through glass while a locked door prevents additions

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

October 27, 2019
Pinal Dave
SQL Interview Questions and Answers
Query Store, SQL Scripts, SQL Server, SQL Server Configuration

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

Read More
Gouache painting of a mountain stream blocked by one large vermilion stone with water backing up behind it

Session Wait Stats: Find the Query Behind a Wait Type

October 26, 2019
Pinal Dave
SQL Performance
SQL DMV, SQL Scripts, SQL Server, SQL Wait Stats

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.

Read More
Title card: Upgrade Rule Failure: No Custom Security Extensions

SQL SERVER – Upgrade Rule Failure Error: No Custom Security Extensions

October 25, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Upgrade

Let us learn about upgrade the rule failure error in this blog post and learn how we can fix the error. Locate RSReportServer.config

Read More
A railway yard where wagons roll into four sidings, one siding far longer than the other three.

Parallel Plans: Reading Gather Streams and Repartition Streams

October 24, 2019
Pinal Dave
SQL Performance
Execution Plan, MAXDOP, Parallel, SQL Performance, SQL Server

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

Read More
Gouache painting of rows of pebbles arranged smallest to largest on a flat rock with one vermilion pebble

Does GROUP BY Sort Results? Only ORDER BY Guarantees It

October 23, 2019
Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Group By, SQL Order By, SQL Scripts

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.

Read More
Previous 1 … 139 140 141 142 143 144 145 … 843 Next
  • Books
  • Testimonials
  • Privacy Policy

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