Compound Assignment Operators let T-SQL do a calculation and an assignment in one step, so SET @Stock -= 2 replaces SET @Stock = @Stock – 2. This post tests all eight operators on SQL Server 2025 with a small garden center inventory. It also shows integer division, NULL, string and flag examples, and where the shorthand does not help.
SQL SERVER – Create a Comma Delimited List Using SELECT Clause From Table Column
I received following question in email : How to create a comma delimited list using SELECT clause from table column?
SQL SERVER – Example of DISTINCT in Aggregate Functions
Does DISTINCT in Aggregate Functions make a difference? Yes. A quick AdventureWorks example compares SUM(DISTINCT ReorderPoint) with a plain SUM.
SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function Part 4
In Day of the Week Function Part 4, I answer why I write a UDF when DATENAME exists (I just like it) and show the one line DATENAME version.
SQL SERVER – Create Default Constraint Over Table Column
A DEFAULT constraint supplies a value when an INSERT omits the column. I test omitted values separately from explicit NULL.
SQL SERVER – UNPIVOT Table Example
UNPIVOT Table is the reverse of PIVOT. This AdventureWorks example turns state columns back into rows, and shows why the detail rows do not return.
Windows Settings That Affect SQL Server
Windows settings can influence SQL Server CPU speed, file growth, memory stability, and security scanning; learn what to inspect and validate.







