XPath first items can mean one per parent or one overall. Compare step-local [1] with a parenthesized path, including full XML and empty selections.
When SSMS and Your Application Return Different Results
Investigate SSMS different results by comparing connections, parameters, session options, transactions, and plans against the application.
Value Histograms: Counting Rows per Range Bucket in T-SQL
Turn a column of amounts into a clear shape. Three small traps decide whether your bucket counts are true: empty buckets, uneven ranges and BETWEEN.
Checking IDENTITY Columns Before They Run Out of Numbers
Check IDENTITY columns for their current value, type limit and remaining range, including descending increments, before inserts fail.
Assigning Rows Round-Robin to Workers With ROW_NUMBER
Number the tasks, number the workers, match them with a remainder. A fair queue in one query, and the two shortcuts that quietly break it.
SQL SERVER – Find Current Location of Data and Log File of All the Database
A one line query on sys.master_files that shows the current data and log file location for all databases, handy when cleaning up old .mdf and .ldf files.
SQL SERVER – List All Server Wide Configurations Values
I forgot the syntax to check the two digit year cutoff, so I listed all Server Wide Configurations with sys.configurations. A small script worth saving.







