Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Last Batch through isqlw 1

Status
Not open for further replies.

BlakeK

Programmer
Oct 1, 2001
59
US
In Enterprise Manager, I can go to Server-Management-Current Activity-Process Info and see a list of what is going on in the system.
In isqlw I can get the same results by running sp_who2

Now, what I need to know...
In Enterprise Manager, once I am looking at the Process Info list, I can right-click on a given process, select "Properties" and it will give me a window with "Process Details - Last TSQL command batch:" and info on what that process is doing.
How can I get that same info via isqlw, if I know a given spid from using sp_who2?
Many times when the SQL Server is having problems, the interactive graphic tools like Enterprise Manager become useless because it will just sit there and not return the Current Activity or time out trying to do it. But the sp_who2 procedure will still work. So I am hoping I can get the more detailed data also through isqlw.

Thanks
 
You can try:

dbcc inputbuffer (SPID) and you will get the last command executed by that spid number.

Hope this helps.


jitter

Instead of shooting where I was, you should have shot where I was going to be. - Lrrr (Planet Nintendio64)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top