[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: Joe Webb
Date: Thu, 31 Aug 2006 06:24:11 -0500
Newsgroups: microsoft.public.sqlserver.notificationsvcs
As Diane mentioned, there's not built in way to have SSNS create a
one-off type of subscription. She's given several good alternatives,

If you choose to go with disabling the subscriber, I've posted some
code to blog that may be of some help.

Joe Webb
SQL Server MVP

Get up to speed quickly with SQLNS 

I support PASS, the Professional Association for SQL Server.

On Wed, 30 Aug 2006 11:41:18 -0700, "Diane Larsen [MSFT]"
<[email protected]> wrote:

>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.

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