Aggregate concatenation queries can return different results depending on where the expression sits. A simple script based on a note I found on Ward Pond’s blog.
SQL SERVER – Discussion – Effect of Missing Identity on System – Real World Scenario
Is there any real world reason to list a missing identity in a table? Readers had no new script, but a lively discussion on whether gaps matter.
SQL SERVER – Puzzle – Write Script to Generate Primary Key and Foreign Key
A puzzle from a migration project: SSMS cannot script every Primary Key and Foreign Key at once. Can you write a script that generates them all?
SQL SERVER – Interesting Observation of Logon Trigger On All Servers – Solution
Why does a logon trigger on all servers fire several times for one login? The answer: several SQL Server services are running and IntelliSense is on.
SQL SERVER – Solution to Puzzle – Shortest Code to Perform SSN Validation
My solution to Jacob Sebastian’s puzzle: the shortest T-SQL code for SSN validation that removes invalid SSN values and returns only the valid ones.
SQL SERVER – Interesting Observation of ON Clause on LEFT JOIN – How ON Clause affects Resultset in LEFT JOIN
Why does a filter in the ON clause on LEFT JOIN give a different result than the same filter in WHERE? Here is my answer to a reader’s question.
SQL SERVER – Observation – Effect of Clustered Index over Nonclustered Index
An observation from my query optimization work: the effect of clustered index on a nonclustered index, shown with a sample table and execution plans.







