sp_who2 Alternative (T-SQL, SQL Server)

May 1, 2018 | 0 Comments

The trusty “sp_who2” is a quick way to look at what’s happening on your SQL instance, but completely lacks the ability to filter using a WHERE clause. You [...]

TSQL – Make Excel Link In Output

August 4, 2016 | 0 Comments

Here is a situation I just came across (boiled down and simplified).  An end user was having to manually find a user id, navigate to an image folder, and [...]

TSQL – Get All Queries Currently Running

August 4, 2016 | 0 Comments

This is perhaps my most commonly used query when troubleshooting. From SQL Server DMV’s in action ebook. The output shows the spid (process identifier), the ecid (this [...]

T-SQL – Get Listener Name on AlwaysOn Cluster

May 25, 2016 | 0 Comments

When using AlwaysOn, you must connect using your listener name, not your node name.  If you connect with the node name, it will only work until there is a failover, which would defeat the purpose of your High Availability setup, right?


Validate SQL Code Without Running It

March 19, 2016 | 0 Comments

Validate SQL Code Without Running It In a nutshell: SET NOEXEC ON; -- The script now will throw all DML errors without executing the code being [...]
1 2