Friday, October 26, 2012

3 How to find out what SQL is currently running by particular session ?

There are at least 2 ways to find out what SQL is running by particular session. DBCC INPUTBUFFER and DMV.

DBCC INPUTBUFFER( Session ID)

Use sp_who to find the session ID. Then run

DBCC INPUTBUFFER(148)

image

DMV

Find the SQL Handle

Select session_id,status,command,sql_handle,database_id
from sys.dm_exec_requests;

image

select session_id,txt from sys.dm_exec_requests r cross_apply sys.dm_exec_sql_text( HANDLE) 
where session_id = id;
 
image

image

3 comments:

  1. Les montres Rolex fausses rolex montress ont fabriquées à partir des meilleures matières premières et fausses rolex cellini montres sont assemblées avec une attention particulière aux détails. Chaque composant est conçu, développé et produit en interne selon les normes les plus strictes.

    ReplyDelete
  2. We've obtained the first pictures showing buy cheap soccer jerseys the authentic 'Match' version of the cheap player jerseys new Nike Euro 2020 template - the England home shirt to be exact. Thanks to NF for the pictures.

    ReplyDelete
  3. Expect heeled and flat styles imbued with a tough attitude in the range of women's Alexander McQueen shoes. ALEXANDER MCQUEEN Bags For Sale Discover richly detailed embellishments, cheap ALEXANDER MCQUEEN bags such as elaborate embroidery on stiletto designs, while chunky buckles and metallic studs lend a defiant edge to flatforms. The British label nods to the athleisure trend with smart trainers featuring pops of contrasting colour and plays on masculine styling with backless loafers in eye-catching shades.

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates