To find resource intensive queries, read sys.dm_exec_query_stats and rank the cached statements by reads, CPU or time. This post builds a small demo, ranks it two ways, and fixes the worst offender with one index. It also explains what the numbers can and cannot tell you.
Draw Pictures with T-SQL: The SSMS Spatial Results Tab
The SSMS Spatial results tab draws every geometry value a query returns. This post draws a house and a tree with STGeomFromText and STBuffer, explains labels and the 5,000 object limit, and checks store service areas for overlaps and gaps.
Order of Operations in SQL Server: How PEMDAS Works in T-SQL
The order of operations in SQL Server follows PEMDAS, so 6/2*(1+2) returns 9. This post walks through the precedence rules with tested queries. It also covers integer division, the negative number trap and AND before OR.
SQL SERVER – Validating Unique Column Name Across Whole Database
A Unique Column Name check lists existing matches across visible database metadata. I use it as an inspection, not an enforcement guarantee.
Effect of Collation on Result Sets in SQL Server
The effect of collation on result sets is easy to see once you run the same query against two collations. This post builds a small demo and shows how sorting, comparing and grouping change. It also explains collation conflicts, including the one temp tables cause.
When One Number Has Three Different Answers
Diagnose reporting inconsistency by matching filters, refresh cutoffs, and row grain before comparing totals from different reports.







