Directly querying the BizTalk database for suspended messages

set nocount on
set transaction isolation level read COMMITTED
set deadlock_priority LOW
 
SELECT
      nvcName as ApplicationName,
      nErrorCategory,
      DATEADD(hh,-5,dtSuspendTimeStamp) as DateSuspended, -- Subtract the appropriate hours for your timezone
      nvcAdapter as Adapter,
      nvcURI as URI,
      nvcErrorDescription as ErrorDescription,
    CASE nState
        WHEN 1 THEN 'Ready To Run'
        WHEN 2 THEN 'Active'
        WHEN 4 THEN 'Suspended Resumable'
        WHEN 8 THEN 'Dehydrated'
        WHEN 16 THEN 'Completed With Discarded Messages'
        WHEN 32 THEN 'Suspended Non-Resumable'
    END as State
FROM InstancesSuspended WITH (NOLOCK)
LEFT JOIN [Services] WITH (NOLOCK)
      on InstancesSuspended.uidServiceID = [Services].uidServiceID
LEFT JOIN Modules WITH (NOLOCK)
      on Modules.nModuleID = [Services].nModuleID
ORDER BY dtCreated DESC
posted @ 2011-12-03 16:13  chunchill  阅读(160)  评论(0编辑  收藏  举报