Explain why DBCC SHRINKFILE can take hours, monitor percent_complete and waits, and use TRUNCATEONLY before small steps.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
SQL SERVER – How to Add an Identity Column Using the IDENTITY Property
How do you add an identity column to a table in SQL Server? I explain three cases using the IDENTITY property, including why a second one fails.
Record Checkout in SQL Server: A Visible Lock With an Expiry Time
Record checkout puts the name of the editor and an expiry time on the row, so a screen can show who has it. This post builds it with one UPDATE and proves it with two sessions that race for 2,000 rows. A check-then-update version gives some rows two winners, and the one-statement version never does. It also covers expired locks, late saves and check-in. Every result comes from SQL Server 2025.
Compatibility Level 170: What SQL Server 2025 Turns On
Move to compatibility level 170 on SQL Server 2025 with feature checks, Query Store baselines, plan comparisons, and a rollback plan.
Reordering a List in SQL Server: Move One Row, Write One Row
Reordering a list in SQL Server means changing a sort key, and the best design writes the fewest rows. This post compares three designs for dragging an item to a new place: renumber everything, shift the rows in between, and leave gaps. Each one is measured by rows written on a list of 1,000 items. Every result comes from SQL Server 2025.
Schema Snapshot: Prove a Deployment Script Is Safe to Run Twice
A schema snapshot records a table’s columns, indexes, constraints and rows, so you can prove a deployment script is safe to run twice. This post runs a plain script twice and watches a price change again. It then guards each step, runs the guarded script twice, and shows that the two snapshots match. Every result comes from SQL Server 2025.
Retrying a Deadlock Victim: When the Retry Helps and When It Hurts
Retrying a deadlock victim works when the retry repeats the whole transaction. This post builds a bounded T-SQL retry for error 1205 and tests it against a real deadlock between two sessions. It then shows two cases where a retry does harm: inside an outer transaction and on an error that is not a deadlock. Every result comes from SQL Server 2025.
SQL Server slow? Let's fix it together in about four hours.
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.

