Solved

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

Posted on 2006-07-03
2
309 Views
Last Modified: 2008-02-01
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
Comment
Question by:RQuadling
2 Comments
 
LVL 2

Accepted Solution

by:
ewahner earned 500 total points
ID: 17030217
sp_who2
0
 
LVL 40

Author Comment

by:RQuadling
ID: 17030236
Well. That was easy! No documentation in BOL though.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now