Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

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?


0
Richard Quadling
Asked:
Richard Quadling
1 Solution
 
ewahnerCommented:
sp_who2
0
 
Richard QuadlingSenior Software DeverloperAuthor Commented:
Well. That was easy! No documentation in BOL though.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now