Tuesday, 31 January 2012 10:40

SQL query to view Subscriptions and their expressions

Written by 
Rate this item
(2 votes)

From the Group Hub in BizTalk 2010 you can have a look at all existing subscriptions. However to have a look at the expression which is related to the instance, you have to open the Subscription Details screen and go to the Expression tab page.

If you need to know all the expressions, you can use the query below:

USE BizTalkMsgBoxDb
SELECT Subscription.nvcApplicationName AS Application,
            Subscription.nvcName AS Name, 
            EqualsPredicates.vtValue AS Subscription,
            Subscription.uidInstanceID AS Instance
FROM    Subscription WITH(NOLOCK)
INNER JOIN Services WITH(NOLOCK) ON Subscription.uidServiceID = Services.uidServiceID
INNER JOIN PredicateGroup WITH(NOLOCK) ON Subscription.uidPredicateGroupID = PredicateGroup.uidPredicateORGroupID
INNER JOIN EqualsPredicates WITH(NOLOCK) ON PredicateGroup.uidPredicateANDGroupID = EqualsPredicates.uidPredicateGroupID
ORDER BY 1, 2

Since this query only shows the so-called Equals predicates, it is far from complete but perhaps this query is helpfull to others as well.

Basically the Subscription part of the data model uses the following tables:

  • Subscription
  • PredicateGroup
  • BitwiseANDPredicates
  • EqualsPredicates
  • EqualsPredicates2ndPass
  • ExistsPredicates
  • FirstPassPredicates
  • GreaterThanOrEqualsPredicates
  • GreaterThanPredicates
  • LessThanOrEqualsPredicates
  • LessThanPredicates
  • NotEqualsPredicates

Depending of the operator used in the expression of the subscription, information is placed in the Predicate tables.

NOTE: take extreme care when querying the BizTalk database. Always use the WITH(NOLOCK) hint. Although possible it is not recommended to do updates to the BizTalk databases with self-created SQL queries.

Read 2234 times Last modified on Wednesday, 08 February 2012 13:09
Lex Hegt

Lex Hegt currently works as a BizTalk architect/administrator at Ordina. Although he works in the Information Technology for more than 25 years, he 'only' works with BizTalk for 8 years. His first BizTalk assignments were as a developer, but since a couple of years he works as an administrator.
Besides this blog he also blogs for many years at the BIA blog and does he maintain some tools, namely BizTalk Processing Monitor and BTSDecompress. He has certifications for BizTalk Server 2006, BizTalk Server 2006 R2 and BizTalk Server 2010.

twitterlinkedin

Website: biztalkia.blogspot.com

1 comment

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.