Need statistics of whole database in one view? My script uses DMVs instead of the deprecated sp_helpstats and shows each stat, column and last update.
CROSS JOIN: Duplicate Inputs Multiply the Result
CROSS JOIN multiplies row counts, including repeated labels. Keep source identifiers and grouped pair counts visible while checking result grain.
SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator
SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.
SQL SERVER – T-SQL Scripts to Find Maximum between Two Numbers
A SQL enthusiast at the airport asked for a simple way to find maximum between two numbers. Here is his clever ABS formula and my CASE version.
SQL SERVER – Selecting Domain from Email Address
A quick T-SQL script to select the domain from email address values with RIGHT, LEN and CHARINDEX, and count how many emails share each domain.
SQL SERVER – Solution – Puzzle – Statistics are not Updated but are Created Once
The solution to my puzzle on why statistics are not updated but are created once after a large insert, even with auto update on, and the fix that worked for me.
SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)
The solution to my puzzle on why SELECT * throws an error but SELECT COUNT(*) does not, with the best reader answers and credit to Rob Farley.






