SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.

How to Set ARITHABORT ON for .NET Applications

A query that runs fast in Management Studio and slow in a .NET application often runs under two different plans, because the two connections use different ARITHABORT settings. This post shows both plans in the plan cache, measures the cost, and explains how to set ARITHABORT ON for all connections through the server’s default connection options.

Continue Reading

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.

Continue Reading