Have you ever wondered what in the hell SQL server is doing at any given moment? Wouldn't it be nice to be able to view the inner workings of SQL at any point in time from the web? Well, it's quite possible.
The trick, is to query the sysprocesses table. This tip, from Julian Sitkewich queries the sysprocesses table, showing us minute information on connections, statuses and processes running or sleeping on the server!
All we have to do is create a simple ASP page and paste the following code into it:
So, what does this code do? Well, it's pretty straight forward, I think. It first creates a connection object and connects to the database of your choice. Next, a recordset object is created and a query on sysprocesses is performed. This recordset object is then displayed in a table. Not much to it, really. Simple, yet powerful.
Be sure to try it out, and see SQL's current status! :)