A random password procedure for SQL Server should use CRYPT_GEN_RANDOM, skip lookalike characters and guarantee every kind of character. This post builds one with a length and character switches, then tests 1,000 passwords. It also covers errors and safe handling.
Generate a Random Password in SQL Server Using T-SQL
To generate a random password in T-SQL, draw bytes from CRYPT_GEN_RANDOM, pick characters from a safe pool and shuffle them. This post builds one procedure that guarantees upper case, lower case, a digit and a symbol, skips look-alike characters, and proves it on 1,000 passwords. It also explains why ABS(CHECKSUM(NEWID())) can fail with an overflow error.
Startup Stored Procedures in SQL Server: Uses and Risks
Startup stored procedures run every time SQL Server starts, which makes them useful and easy to forget. This post covers good uses, the risks, a wait that gives up instead of looping forever, and how to list and remove the startup stored procedures already on a server. The setup steps are in a separate post.
SQL SERVER – Execution Plan Ignores Tabs, Spaces and Comments
Many teams skip comments in stored procedures, fearing bigger execution plans. My demo shows SQL Server ignores tabs, spaces and comments when it builds a plan.
How to Estimate Space Saved by Data Compression in SQL Server? – Interview Question of the Week #167
How to estimate space saved by data compression in SQL Server? Use the built-in sp_estimate_data_compression_savings procedure. Here is a quick example.
Temporary Stored Procedures in SQL Server: Local and Global
Temporary stored procedures start with one # sign for a local one and two for a global one, and both live in tempdb. This post creates each kind on a demo database, shows who can call them and when they disappear, and explains which database their object names resolve in. It ends with the habit that makes them useful for testing a rewrite.
Asterisk Instead of a Number: A SQL Server Puzzle
This puzzle assigns a nine digit number to a varchar(8) variable and gets an asterisk instead of a number. The answer is an implicit conversion that does not fit. The post tests which data types behave this way, which ones raise an error, and how to size the variable.






