I’ve received a number of requests over the past couple of years for an Azure-specific version of sp_whoisactive. Given the combination of a lack of interesting DMVs available in Azure and my general lack of interest in all things Azure related, creating a modified version of the proc has not exactly been a top priority.
Luckily, now I don’t have to. Microsoft made a number of enhancements to the newest version of Azure SQL Database–v12–including adding all of the DMVs. Even the deprecated ones!
I just tested sp_whoisactive in a new instance, and it appears to work perfectly!
The only caveat: The proc has a reference to a couple of views in MSDB, which are not available in Azure. (Makes sense, since you don’t have access to Agent and other msdb-type features in Azure.) To get it to compile I had to comment out those lines: All the code between lines 4601 and 4635 of the sp_whoisactive v11.11 script.
I’ve attached a version of the script to this blog post that has the lines commented out. I’m not sure if there are other issues hiding somewhere, but so far (very thorough testing for all of 5 minutes in an almost completely empty database) everything seems to be fine.
In other words, there are probably some issues–if you test and see anything awry, please post a comment here and I’ll work on it.
File Attachment: who_is_active_v11_111.zip