Deadlock Sleuth

SQL Server’s Extended Events (XE) contain a feature that makes it easy to track down deadlocks. In stark contrast to Profiler, the Extended Events engine is always running, even in production, and has been so since SQL Server 2008. In 2012 XE got a GUI and you can find the always-running session titled “system_health” in SQL Server Management Studio (SSMS) under Object Explorer > Management > Extended Events > system_health. It writes to the ring buffer and an event file.... Continue reading →

Merge One SQL Column with a Delimiter While Selecting Others

A colleague posed a question, and I thought I’d post the answer here in case I needed to find it in the future, or others needed something like it. I found similar examples on the internet, but not quite like this, where a table needed to be filtered and ordered for the column that was merged, while listing other columns from the initial table. If the subquery filtering for tax returns blank or nothing, still return ‘SALES TAX’. Combine them... Continue reading →