Monthly Archives: March 2016

Find and kill long running MS SQL Server queries

I have to admit this is cargo cult SQL to me, but here’s how to find running queries, sorted by their total elapsed time: SELECT [sqltext].[TEXT], [req].[session_id], [req].[status], [req].[command], [req].[cpu_time], [req].[total_elapsed_time] FROM [sys].[dm_exec_requests] [req] CROSS APPLY [sys].[dm_exec_sql_text](sql_handle) AS sqltext ORDER BY [req].[total_elapsed_time] DESC To kill a given query, use: kill <session_id> ..without the brackets <>, […]

SPF exists for a reason, and postfix makes it ridiculously easy

In the bronze age, messages came in, signed bob@lamuella.com, and you’d simply have to assume they were from the Almighty Bob. Today, email is still technically in the iron age, but at least we have SPF. In a nutshell, when lamuella.com enables SPF for their domain, they can be sure that other people, which mail […]