Remove BizTalk orphans from tracking

Here a SQL Script to remove orphans from your BizTalk tracking. It sets an end date so they can be removed.

USE [biztalkDTADb]


UPDATE
    [dbo].[dta_ServiceInstances]

SET
    [dtEndTime] = GetUTCDate()
WHERE
    dtEndTime is NULL
    AND
    [uidServiceInstanceId] NOT IN
    (
    SELECT
        [uidInstanceID]
    FROM
        BizTalkMsgBoxDb.[dbo].[Instances] WITH (NOLOCK)
    UNION
    SELECT
        [StreamID]
    FROM
        BizTalkMsgBoxDb.[dbo].[TrackingData] WITH (NOLOCK)
    )

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.