Reset identity values with DBCC CHECKIDENT, distinguish DELETE from TRUNCATE, and prove that identity alone does not prevent duplicates.
SQL SERVER – Generating Row Number Without Ordering Any Columns
ROW_NUMBER needs an ORDER BY clause, but what if you do not want to sort by any column? Here is a simple trick to generate a row number without ordering.
Interview Question of the Week #018 – Script to Remove Special Characters – Script to Parse Alpha Numerics
Remove special characters with a corrected SQL Server loop and a 2025 regex expression, while defining ASCII and collation rules.
SQL SERVER – Recovering from Snapshots – Notes from the Field #078
Data deleted by accident? John Sterrett explains recovering from snapshots, a very useful but less used feature, without panic making things worse.
SQL SERVER – Script: Knowing Data and Log Files Are On the Same Drive
At GIDS I talked about keeping data and log files on separate drives. Here is a script that shows which databases have data and Log Files on the same drive.
SQL SERVER – Finding Tables with Primary or Foreign Keys
How do you find which tables have a primary key or foreign key? Here are simple queries for finding tables with primary or foreign keys in a database.
How to Identify Cross-Database Transactions in SQL Server
To find cross-database transactions, search the code for references to other databases, watch a live transaction with a DMV, or read special records in the transaction log. This post tests all three on two demo databases. It also shows why a popular log script flags a brand new database.





