[Top] [All Lists]

Re: What is the best way to implement a 1 time match for a Subscription?

Subject: Re: What is the best way to implement a 1 time match for a Subscription?
From: "Diane Larsen [MSFT]"
Date: Wed, 30 Aug 2006 11:41:18 -0700
Newsgroups: microsoft.public.sqlserver.notificationsvcs
Here are some ideas from an NS presentation a couple of years ago:

1. Disable the subscription.

2. Maintain subscription history in a chronicle, and check the chronicle 
when generating notifications.

3. Use a subscription chronicle to set an expiration time for the 

a. At subscription time
 Delta = ExpirationTime - StartTime (in local time)
 Store Delta in subscription

b. Build a subscriptions chronicle (exclusion list)
 With the expiration time (in UTC)

c. When the scheduled rule fires
 On the first rule firing
  Set ExpirationTime in the subscription chronicle
  ExpirationTime = UTCNow + s.Delta
 Generate a notification when
  server time <= sh.expirationTime
d. Subscriptions are automatically expired (excluded) by the match rule
e. Physically delete expired subscriptions using SQLNS API

4. If you want to disable all subscriptions for a subscriber, disable the 

5. Create a subscriber chronicle table and then check the subscriber 
chronicle when generating notifications.

Diane Larsen [MSFT]
SQL Server User Education

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at

"Keith Varga" <[email protected]> wrote in message 
news:[email protected]
>I would like to create a subscription that once a Notification is generated 
>for the subscription it becomes disabled.   If there a way to do this 
>automatically?  If not, any recommendations?
> FYI.. We do have our own custom formatter and delivery protocol/channel. 
> It might be possible to disable the subscription in these.

<Prev in Thread] Current Thread [Next in Thread>