IS DISTINCT FROM compares nullable values without inventing a sentinel. Test two NULLs, one NULL and changed values, then use the predicate to find transitions that ordinary equality can miss.
GTIN-13 Check Digits: Validate the Final Digit in a CHECK Constraint
A GTIN-13 check digit validates a weighted checksum, not product identity. Test complete ASCII input, leading zeros and the final digit in a CHECK constraint, then see why some digit swaps still pass.
geometry STNumPoints: Closing Coordinates Count Again
geometry STNumPoints counts coordinates in the spatial description. A square ring contains its closing coordinate as well as its four distinct corners.
SQL SERVER – Difference between COUNT(DISTINCT) vs COUNT(ALL)
What is the difference between COUNT(DISTINCT) and COUNT(ALL)? A student asked me at a college session, and one quick script made the answer clear.
geometry STGeometryType: Type Names Say More Than Dimension
geometry STGeometryType identifies the represented shape type, which carries more information than its dimension. I compare single and multiple shapes in one small query. Equal dimensions do not mean that their structures are interchangeable.
SQL SERVER – Running Multiple Batch Files Together in Parallel
I needed SQL code running in parallel for a demo, so I used sqlcmd and start cmd.exe to run multiple batch files together. Can PowerShell do it better?
hierarchyid GetAncestor: Stop at the Root
hierarchyid GetAncestor returns a logical ancestor path. Its zero-distance result is the original node, while a request beyond the root returns NULL.





