I've got 20 different databases on 5 different SQL servers.
I have a web page which examines all the databases on all the servers, reporting who is logged in to a specific set of applications. This is all working fine.
I want to add to my web page (which is an on demand page, not a constant refresh and is used probably once or twice a week) the idle time, based upon the datetime of the last batch in the Process Info page of EM.
I see that I can use "exec sp_who" to get the data about who's connected to the DBS and which DB they are using. That's fine. But I already have that (to a degree).
I can't see how to get the last batch column.
2 of the servers are SQL7, the rest are SQL2K. We will be adding an SQL2K3 to the network soon.