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 – Order Of Column In Index
Adding more columns does not make an index better. The order of column in index matters most, since an index is used only when its first column is in the query.
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.
SQLAuthority News – 3 Million Readers and Continuing Journey
SQLAuthority passed 3 Million readers. Thank you for your active participation. Here are my best and favorite articles if you want to keep reading.
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.
SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 3
Nanda Kumar improved the UDF to get the day of the week: it now uses the date you pass in instead of GETDATE() and handles Saturday correctly.










