Posted By

marcocs on 09/23/09


Tagged

admin Mantenimiento


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Last statement run for a specific SQL Server session


 / Published in: SQL
 

URL: http://www.mssqltips.com/tip.asp?tip=1799

Identify last statement run for a specific SQL Server session Written By: Tim Ford -- 7/22/2009

  1. SELECT DEST.TEXT
  2. FROM sys.[dm_exec_connections] SDEC
  3. CROSS APPLY sys.[dm_exec_sql_text](SDEC.[most_recent_sql_handle]) AS DEST
  4. WHERE SDEC.[most_recent_session_id] = @PID

Report this snippet  

You need to login to post a comment.