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 – Introduction to SQL Server Encryption and Symmetric Key Encryption Tutorial with Script
SQL Server Encryption keeps stolen data unreadable. Learn the three level encryption hierarchy, then follow a symmetric key encryption tutorial with the script.
SQL SERVER – List All the Tables for All Databases Using System Tables
A one line script with sp_msforeachdb and sys.tables to list all the tables for all databases on a server, updated with ideas from reader comments.
SQL SERVER – Leading Zero to Number
Readers keep asking how to add a leading zero to a number. Here are my two earlier articles that pad a number with zeros for a fixed width display.
FOR XML PATH: Choose Attributes and Nested Elements With Aliases
FOR XML PATH interprets column aliases as directions for the output’s attributes and element hierarchy. I use three aliases to shape two rows. The source columns stay ordinary relational values.
geometry Line Endpoints: Preserve the Described Direction
geometry line endpoints identify the first and last described points. Reversing the same path exchanges them, while a closed line starts and ends together.






