Actual Execution Plan or Estimated Execution Plan? I always use the actual plan because it is accurate. Shortcuts: CTRL+M for actual, CTRL+L for estimated.
SQL SERVER – 2005 – Use Always Outer Join Clause instead of (*= and =*)
My friend’s queries failed in SQL Server 2005 because they used *= and =* for joins. Always use the LEFT or RIGHT outer join clause instead.
GROUPING_ID: Separate Stored NULL Values From ROLLUP Totals
GROUPING_ID helps me distinguish a stored NULL from a subtotal created by ROLLUP. Both can appear in the same column. I keep the grouping bits beside the numbers before adding presentation labels.
SQL SERVER – T-SQL Script to Attach and Detach Database
Detach Database operations remove a database from its instance without deleting its files. I preserve a recoverable backup before moving them.
SQL SERVER – T-SQL Script to Insert Carriage Return and New Line Feed in Code
Add a carriage return with CHAR(13) and a New Line Feed with CHAR(10) in T-SQL. Handy for formatting output, dynamic SQL with GO, and saving user text.






