After an upgrade, a DBA’s management asked if any deprecated or discontinued features were still in use. Here is how to find that out on a live server.
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.
SQL SERVER – Who ALTER’ed My Database? Catch Them Via DDL Trigger
A reader’s database kept switching back to compatibility level 80 every day. Here is how a DDL trigger can catch who ALTERed the database and when.
SQL AZURE – How to Disable and Enable All Constraint for Table and Database
sp_msforeachtable does not work in Azure SQL Database. Here is how to disable and enable all constraint for table and database in SQL Azure using DMVs.
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.




