November 15, 2011 at 7:06 am
Hi Folks..
Just want to know lastn night we had issues with long running queries and we identify the session and killed it.
But i want to know which query was running on that particular SPID so is there any way to find out ?
Thanks
November 15, 2011 at 7:23 am
There would have been a way before you killed it, but not now.
With the connection still open, you could query sys.dm_exec_connections, cross apply sys.dm_exec_sql_text using the most_recent_sql_handle column. But that would have had to be done prior to killing the SPID. Nothing's possible now unless you had some form of tracing running at the time.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 15, 2011 at 8:15 am
Thanks for info ya i am trying to look in default trace file .but i dont have access to go there . but thanx for help
November 15, 2011 at 8:48 am
The default trace does not contain last run SQL statements, DML or anything like that. It's a light-weight trace that stores DDL, some security info, DB and server config changes and little more.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 15, 2011 at 8:56 am
ya thats true i just figured out ..Thank for your kind reply.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply