|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:54 PM
Points: 77,
Visits: 301
|
|
We have SQL Server 2005. We have several scheduled jobs using SSIS with numerous stored procedures running both in line and parallel. Some of these jobs have single steps (not SSIS) that execute stored procedures.
Using sys.dm_exec requests, I can identify the SPid that is blocking. The login is a service account and not identified to a particular user, but mostly used for the scheduled jobs and some other processes not for a particular user.
Is there a way to identify the actual query/Stored Procedure/SSIS procedure that is causing the block?
Thanks in advance.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 2:33 PM
Points: 37,741,
Visits: 30,019
|
|
Yes. Query sys.dm_exec_requests and CROSS APPLY sys.dm_exec_sql_text. The column text will give you the batch or proc that the session is running.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 12:54 PM
Points: 77,
Visits: 301
|
|
| Thanks. I have never used the CROSS APPLY, but will learn.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 2:33 PM
Points: 37,741,
Visits: 30,019
|
|
Books Online does have sample code under either sys.dm_exec_requests or sys.dm_exec_sql_text (or maybe both)
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|