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 a row of measuring jugs at different levels with a fresh one filled through a vermilion funnel

UPDATEUSAGE and Space: What It Fixes and What It Does Not

July 26, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server DBCC

UPDATEUSAGE and space are two jobs: the command corrects page and row counts but frees no space. See a test where it finds nothing and a rebuild shrinks the table.

Read More
Gouache painting of a row of clay tiles with one cracked tile marked by a vermilion dot and a magnifying glass

Find Damaged Pages in SQL Server With suspect_pages

July 12, 2021
Pinal Dave
SQL Tips and Tricks
Database Corruption, SQL Scripts, SQL Server DBCC, SQL System Table

Find damaged pages in SQL Server by reading msdb.dbo.suspect_pages. Decode the event type, find the table behind each page and know what to do next.

Read More
Gouache painting of a spinning cog, a block tower and a toy barn with a vermilion door on a shelf

DBCC CHECKIDENT: Check and Fix the Next Identity Value

May 17, 2021
Pinal Dave
SQL Tips and Tricks
SQL Delete, SQL Identity, SQL Scripts, SQL Server DBCC

DBCC CHECKIDENT reports the next identity value of a table and can change it. This post runs NORESEED, the no-option form and RESEED on a small demo table. It shows how DELETE and TRUNCATE treat the counter, the duplicate key error from a value that is too low, and who may run the command.

Read More
Gouache painting of a cottage wall with closed shutters and one open vermilion shutter

Check Trace Flag Status With DBCC TRACESTATUS

January 5, 2021
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server DBCC, TraceFlags

DBCC TRACESTATUS checks trace flag status. Run it with -1 to list every flag that is on, or with flag numbers to test them one by one. This post turns on a harmless session flag, reads its scope, finds startup flags, and stores the result in a table.

Read More
Gouache painting: a still canal at dawn with four wooden barges moored in a row, each loaded with a stack of hay bales of a different height, the fourth barge still empty, and one vermilion ribbon tied to the nearest stack

percent_complete: Which Commands Show Real Progress

December 31, 2020
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL DMV, SQL Monitoring, SQL Server DBCC

percent_complete tells you how far a running command has come, but only some commands fill it in. This post times eleven commands on SQL Server 2025, shows which ones report real progress and which stay at 0, and adds a way to watch the silent ones.

Read More
Gouache painting of three wheelbarrows queuing at a narrow gap in a stone wall, the one in the gap vermilion

DBREINDEX and MAXDOP: Use ALTER INDEX to Limit Parallelism

December 24, 2020
Pinal Dave
SQL Tips and Tricks
MAXDOP, Parallel, SQL Index, SQL Server DBCC

DBREINDEX and MAXDOP do not combine: DBCC DBREINDEX has no MAXDOP option, so it follows the server setting. This post shows the three errors, rebuilds a demo index with ALTER INDEX at different MAXDOP values, and measures the degree of parallelism each one used.

Read More
The same accordion basket construction appears compact and expanded

How to Change Database File Size? – Interview Question of the Week #296

October 4, 2020
Pinal Dave
SQL Interview Questions and Answers
Shrinking Database, SQL Performance, SQL Scripts, SQL Server, SQL Server DBCC

Question: How to Change Database File Size?

Answer: By Shrinking the files. Now, many have a negative opinion about Shrinkfile.

Read More
Previous 1 2 3 4 5 … 16 Next
  • Books
  • Testimonials
  • Privacy Policy

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