LIKE ESCAPE expresses a literal punctuation search. Preserve the distinction between wildcard pattern instructions and stored text.
SQL SERVER – Get Query Plan Along with Query Text and Execution Count
A handy script that shows each query’s text, its execution count and its query plan, so you can see what runs most often on your server.
SQL SERVER – Introduction to Change Data Capture (CDC) in SQL Server 2008
My first article on Simple-Talk introduces Change Data Capture in SQL Server 2008, which records INSERTs, UPDATEs and DELETEs in simple relational change tables.
SUM DISTINCT: Equal Amounts Are Not Duplicate Rows
SUM DISTINCT totals different amounts without checking order identity. I’d establish the row grain first. Compare equal-priced orders, repeated copies and missing amounts.
Modulo: Negative Values Keep the Dividend Sign
Modulo can return a negative remainder for a negative dividend. A second expression normalizes a positive-divisor bucket while keeping the original input and remainder visible.
SQL Server – Multiple CTE in One SELECT Statement Query
How do you use multiple CTE in one SELECT statement? Two simple examples: independent CTEs joined together, and a second CTE built on the first.







