How do I get "Last Batch" time from EM's Process Info, via T-SQL.

Hi.

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.

Any ideas?


LVL 40
Richard QuadlingSenior Software DeveloperAsked:
Who is Participating?
 
ewahnerConnect With a Mentor Commented:
sp_who2
0
 
Richard QuadlingSenior Software DeveloperAuthor Commented:
Well. That was easy! No documentation in BOL though.
0
All Courses

From novice to tech pro — start learning today.