Posts

Showing posts from February, 2021

Cheatsheet - SQL RAISERROR

https://chadbaldwin.net/2021/01/15/raiserror-cheatsheet.html  

Unusual Parameter Sniffing: Big Problems with Small Data

https://www.brentozar.com/archive/2021/02/unusual-parameter-sniffing-big-problems-with-small-data/  

Partitioned Tables Cause Longer Plan Compilation Times

https://www.brentozar.com/archive/2021/02/partitioned-tables-cause-longer-plan-compilation-times/  

My TRANSACTION Notes

XACT_STATE()  https://docs.microsoft.com/en-us/sql/t-sql/functions/xact-state-transact-sql?view=sql-server-ver15 0 = no active transaction 1 = active transaction -1 =  active transaction but your only option is ROLLBACK (it's doomed) @@TRANCOUNT BEGIN TRANSACTION increments by 1 COMMIT TRANSACTION decrements by 1 ROLLBACK TRANSACTION sets to zero (except when using SAVEPOINT) SET XACT_ABORT { ON | OFF } ON = error causes transaction to ROLLBACK   Paul Randal: Open Transactions with Script and Plan