SQL SERVER Get Latest SQL Query for Sessions DMV

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Wed, 05 May 2010 00:00:00 GMT Indexed on 2010/05/05 2:48 UTC
Read the original article Hit count: 200

Filed under:
In recent SQL Training I was asked, how can one figure out what was the last SQL Statement executed in sessions. The query for this is very simple. It uses two DMVs and created following quick script for the same. SELECT session_id, TEXT FROM sys.dm_exec_connections CROSS APPLYsys.dm_exec_sql_text(most_recent_sql_handle) AS ST While working with DMVs if you [...]...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner