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
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
Title card: The Specified Service Does Not Exist as an Installed Service

SQL SERVER – Upgrade Error: The Specified Service Does Not Exist as an Installed Service

October 22, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Server Installation, SQL Upgrade, Starting SQL

An upgrade from SQL Server 2008 R2 to 2014 failed after the product key step with: the specified service does not exist. Here is the fix.

Read More
Title card: Log Shipping: Only Members of Sysadmin Can Do This

SQL SERVER – Log Shipping Error: Only Members of the Sysadmin Fixed Server Role Can Perform This Operation

October 21, 2019
Pinal Dave
SQL Tips and Tricks
Log Shipping, SQL Error Messages, SQL Scripts, SQL Server

They have observed that Log Shipping Copy and Log Shipping Restore jobs have been failing with log shipping error. Let us fix them.

Read More
Previous 1 … 58 59 60 61 62 63 64 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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