The “SHOW PROCESSLIST;” equivalent in Microsoft SQL-Server

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, March 17, 2011

Follow me on Twitter as @mattiasgeniar

We, MySQL users, are spoiled. We don’t realize it, until we have a Microsoft SQL-Server in front of us. For MySQL, you have the following wonderful command.

mysql > SHOW PROCESSSLIST;
mysql > SHOW FULL PROCESSLIST;

That will list all active connections, the query being executed and the state (waiting for MySQL to process it, sending data, sleeping, … ).

If you’re in SQL Server Management Studio, you can do the following via “New Query”.

sp_who;

Or

sp_who2;

Not quite the same, but it also shows you the connected users and the state of that connection. “sp_who;” will list all users, and “sp_who2;” will increase the output with things like CPU time, Disk IO, …



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.