Get Current Activity in SQL Server instance

 [Update: Version 2.0 uploaded with some bug fixes] When troubleshooting customer’s performance issue that’s happening at the moment, we have many tools out of the box. The good old SQL traces that are not needed for the majority of the cases and if it’s needed then my first option would ne XE if we are…

0

Select everything from every table in every database

[Caution: This is for testing only if you want to have a cached dataset, will have severe issues in production servers if you just executed it for trial]   We all know the undocumented (then it’s not supported) procedure that executes a code in every database which is sp_msforeachdb And its twin that executes against…

0

Inequality predicates do not trigger scans

I see sometimes there is an understanding that when using inequality operators in the where clause, this will make the query optimizer decide to do a table scan for the table or index and will not use seek operations. Sometimes this is called non-SARGable predicate. This blog post is to discuss this understanding, but if…

0

New columns in exec_sessions DMV in SQL 2012

While reproducing the issue with DBCC OpenTran I wrote about earlier this week here I found a pleasant addition to the sys.dm_exec_sessions DMV. In SQL 2012 we have 3 new columns added Open_transaction_count: which shows the number of open transactions for the session whether or not these transactions are reading or writing. So an open…

0