Just a quick note on a scenario I ran into, and what I did to…
Category: Programming
SQL Server Maintenance Plan Backups Failing On Secondary Replica in High Availability Environment
When a High Availability (HA) environment failed over, on the node that became Secondary, the…
TSQL – Make Excel Link In Output
Here is a situation I just came across (boiled down and simplified). An end user…
TSQL – Get All Queries Currently Running
This is perhaps my most commonly used query when troubleshooting. From SQL Server DMV’s in…

PowerShell – Update All SQL Services To Restart On Failure
PowerShell script to quickly change all Recovery Options to “Restart the Service”. https://gist.github.com/benf101/a3c7020c0a582aca06059b750bd08528
PowerShell – Create And Write Out To Log File
Creating and writing to output file in PowerShell.
Generate Red Gate MultiScript .dat File
This is a PowerShell script that puts out the XML required to update your Red…
T-SQL – Get Listener Name on AlwaysOn Cluster
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?
SQL Server – Timestamp Column
While this seems like a simple thing to do, I recently discovered so many ways not to do it (also known as failing) that I just had to document this one.
PowerShell – Get All SQL Instances On Server
This script will return all SQL instances running on a server or list of servers….