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
Gouache painting of three wooden shape sorter boxes with a single vermilion peg in front of them

Delete Qualified Rows From Multiple Tables: A SQL Puzzle

July 13, 2019
Pinal Dave
SQL Puzzle
SQL Delete, SQL Performance, SQL Scripts

Delete qualified rows from multiple tables with as few logical reads as you can. This puzzle gives a setup script for three small tables, the two rules for the delete and a starting script that costs 19 logical reads. Your task is to beat that number and stay correct.

Read More
A beach volleyball net standing intact on smooth sand at dawn, every footprint around it washed away by the tide.

SCHEMA_ONLY vs SCHEMA_AND_DATA for Memory-Optimized Tables

July 12, 2019
Pinal Dave
SQL Tips and Tricks
In-Memory OLTP, SQL Log, SQL Memory, SQL Server

Compare SCHEMA_ONLY and SCHEMA_AND_DATA memory-optimized tables, inspect logging and recovery, and test an isolated offline-online cycle.

Read More
Gouache painting of a bare kitchen counter with one vermilion jar brought back from the pantry

DBCC DROPCLEANBUFFERS Impact on Memory: See a Cold Cache in Action

July 11, 2019
Pinal Dave
SQL Performance
SQL Memory, SQL Scripts, SQL Server DBCC

DBCC DROPCLEANBUFFERS removes every clean page from memory, so the next query reads from disk. This post counts the pages of one database before and after, shows why a CHECKPOINT comes first, and compares a cold read with a warm read.

Read More
Gouache painting of a row of wicker baskets lined up beside one small balance scale, one basket vermilion

PARALLEL_BACKUP_QUEUE Wait on a Slow RESTORE FILELISTONLY

July 10, 2019
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Server, SQL Wait Stats

A reader asked me what the PARALLEL_BACKUP_QUEUE wait means. Their RESTORE FILELISTONLY ran for a long time on a backup of about 1.5 TB and ended with a media error. I believe a problem with the backup media makes the command run long and shows this wait.

Read More
Asparagus shoots growing in close groups separated by a broad patch of bare soil

Sessionizing Events: Grouping Activity Into Sessions by Idle Gap

July 9, 2019
Pinal Dave
SQL Tips and Tricks
SQL Activity Monitor, SQL Extended Events, SQL Server

Your events have a user and a time but no visit ID. Here is how to infer sessions from an idle gap with LAG and a running sum.

Read More
Gouache painting of two matching teapots wearing each other's lids, one lid vermilion

Logical Name Mismatch: master_files vs database_files

July 8, 2019
Pinal Dave
SQL Tips and Tricks
AlwaysOn, SQL DMV, SQL Error Messages, SQL System Table

A logical name mismatch means sys.master_files and sys.database_files disagree about a file name. A tested demo shows both views on one server, and a script checks every database. The post explains the secondary replica case and its fix.

Read More
A small potted plant is connected to a larger source plant

What is Source_Database_ID in Sys.Databases?- Interview Question of the Week #232

July 7, 2019
Pinal Dave
SQL Interview Questions and Answers
Snapshot, SQL High Availability, SQL Scripts, SQL Server, SQL System Table

Question: What is Source_Database_ID in Sys.Databases and why it is mostly NULL? Very interesting question, I received indeed.

Read More
Gouache painting of a jammed grain chute in a barn with sacks piled high and the top sack in vermilion

sysxmitqueue in msdb: Why It Grows and How to Clear It

July 6, 2019
Pinal Dave
SQL Tips and Tricks
Service Broker, SQL Scripts, SQL Server, System Database

Sysxmitqueue in msdb fills up when Service Broker messages cannot leave the server. A tested demo in its own database shows the pile, the reason, a one conversation cleanup and the NEW_BROKER reset. The msdb steps follow the same order.

Read More
Gouache painting of key-marked folders copied between database cabinets with a duplicate-key warning

DBCC CLONEDATABASE Error Msg 2601: Cannot Insert Duplicate Key Row in sys.sysowners

July 5, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server DBCC, SQL Server Security

A DBCC CLONEDATABASE error that names sys.sysowners points at a database user name, not at the database owner. The queries here find the conflicting user in model and in the source database, and I tested them on SQL Server 2025 along with a clean clone.

Read More
Gouache painting of key-marked folders copied between database cabinets with a duplicate-key warning

SQL SERVER – DBCC CLONEDATABASE Error: Cannot Insert Duplicate Key Row In Object ‘sys.sysschobjs’ With Unique Index ‘clst’.

July 4, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Server DBCC, SQL System Table, System Database, System Object

Investigate a DBCC CLONEDATABASE sys.sysschobjs error with supported catalog checks, original screenshots and a distinct build-specific fix.

Read More
Previous 1 … 108 109 110 111 112 113 114 … 591 Next
  • Books
  • Testimonials
  • Privacy Policy

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