Explain why DBCC SHRINKFILE can take hours, monitor percent_complete and waits, and use TRUNCATEONLY before small steps.
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.
State Machine in T-SQL: Allowed Status Changes for an Order
A state machine in T-SQL keeps the allowed status changes in a table and rejects every other change. This post builds one for orders with a transitions table and a trigger, then tests a bad jump, several rows in one UPDATE, new orders, a transaction and a new rule. Every result comes from SQL Server 2025.
SQL SERVER – What is the Maximum Relational Database Size Supported by Single Instance?
How much data can SQL Server handle? The maximum relational database size is 524 PB in SQL Server 2008 R2, 2012 and 2014, with a lower limit for Express.
Finding Which Statistics a Query Used in the Execution Plan
Find which statistics a query used through OptimizerStatsUsage in actual-plan XML, cached plans, and Query Store history.










