THROW or RAISERROR changes how SQL Server handles severity, formatting, and XACT_ABORT; choose the right pattern for new procedures.
SQL SERVER – Effect of TRANSACTION on Local Variable – After ROLLBACK and After COMMIT
What is the effect of a TRANSACTION on local variable values after ROLLBACK and after COMMIT? A short example I wrote for a Jr. Developer shows the answer.
SQL SERVER – Order of Result Set of SELECT Statement on Clustered Indexed Table When ORDER BY is Not Used
A Clustered Indexed Table still needs ORDER BY to promise result order. I declare the order the reader or application requires.
SQL SERVER – Stored Procedure to Know Database Access Permission to Current User
Which databases can I use? Run EXEC sp_MShasdbaccess to see the database access permission of the current user. Our Jr. DBAs check it all the time.
SQL SERVER – 2005 – Version Information and Additional Information – Extended Stored Procedure xp_msver
EXEC xp_msver returns SQL Server version information plus server details like platform, language and file version, with no need to check Windows system info.
SQL SERVER – 2005 – Multiple Language Support
Multiple language support in SQL Server: sys.syslanguages holds the details for each language, including month and day names. One query lists them all.
SQL SERVER – Rename Database to New Name Using Stored Procedure by Changing to Single User Mode
How we rename database copies on our development server: set it to single user mode, run sp_renamedb, then set it back. The file names do not change.
Scaling Out Read Queries
Scaling out read queries uses replicas, caches, and routing with measured freshness and operating cost; learn when each path fits.
SQL SERVER – UDF – Validate Positive Integer Function – Validate Natural Integer Function
A Jr. DBA at my company changed my integer check so it accepts only a positive integer. I share his udf_IsNatural function with a few test values.










