Transact SQL – Drop Temp Table if it it exists

Background Reviewing some Transact SQL Code and saw a code block that works well in exception handling, but can have a bit of side effect in Transact SQL. Code Original Code SQL Explanation When the temp table does not exist, an error is raised. Because the drop table is enclosed in a try/catch block the … Continue reading Transact SQL – Drop Temp Table if it it exists

SQL Server – Set Options – Detecting Current Settings

Background Set options can have devastating effect on SQL Server Operations.  I am too shamed to talk about once it bit me terribly. Other times, setting one or a couple of them helped us. Setting XACT_ABORT on is very important when changing data within Stored Procedure. Setting TRANSACTION ISOLATION LEVEL  to "read uncommitted" could possibly help … Continue reading SQL Server – Set Options – Detecting Current Settings