Learn why GO is not T-SQL, how batches reset variable scope, what GO 3 repeats, and how applications should send scripts safely.
SQL SERVER – Adding Column Defaulting to Current Datetime in Table
How do you add a column that fills in the current datetime when a row is inserted? A sample table and a column with a default value that does it for you.
Reseed an Identity Column in SQL Server: SQL in Sixty Seconds #051
To reseed an identity column, run DBCC CHECKIDENT with the RESEED option. The tests here show which value comes next after existing rows, DELETE and TRUNCATE, and what happens when the new value collides with a key.
Table Partitioning Is Not Sharding: What Partitioning Really Gives You
See why partitioning is not sharding, build monthly partitions, inspect elimination, and switch a month out for simpler data management.
Backup Retention: How Long to Keep What
Backup retention should preserve restore chains while meeting recovery, legal, and storage needs across full, differential, and log backups.
SQL SERVER – sys.dm_xe_map_values – Reasons for Statement Recompilation
What are all the reasons a statement recompiles? I found the full list with the DMV sys.dm_xe_map_values, handy when you read a Profiler or Extended Events trace.
Adding IDENTITY to an Existing Column With ALTER TABLE SWITCH
Add IDENTITY to an existing column with an empty matching table, ALTER TABLE SWITCH, a reseed, and full dependency checks.
SQL SERVER – DELETE From SELECT Statement – Using JOIN in DELETE Statement – Multiple Tables in DELETE Statement
After my UPDATE from SELECT post, many readers asked about using JOIN in DELETE statement. It is possible, and I show how with multiple tables.
UNMASK on One Column: Granting Unmasking in SQL Server 2022
Support needs phone numbers but not salaries. Here is how to unmask one column, and what that permission does not do.










