microsoft.public.sqlserver.notificationsvcs
[Top] [All Lists]

Re: Multiple devices for a subscription

Subject: Re: Multiple devices for a subscription
From: Joe Webb
Date: Tue, 23 Aug 2005 13:36:04 -0500
Newsgroups: microsoft.public.sqlserver.notificationsvcs
Ah....Very nice solution! Thanks Shyam!

-- 
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811 

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Tue, 23 Aug 2005 11:28:22 -0700, "Shyam Pather [MSFT]"
<[email protected]> wrote:

>Wayne,
>This is actually quite simple to do. Remember that the match rule is just a 
>join that produces the notification rows. Each row represents a notification 
>going to one device. So if you want to have the same notification sent to 
>multiple devices, you just need to write your match rule in such a way as to 
>produce multiple rows with the same notification data, but different device 
>names. Here's an example of one way to do it:
>
>Keep a table that stores a mapping of subscriptions to devices. For example:
>
>CREATE TABLE SubscriptionDeviceMappings
>(
>    SubscriptionId bigint,
>    SubscriberId nvarchar(255),
>    DeviceName nvarchar(255)
>)
>
>In your match rule, you simply join like this:
>
>SELECT ....
>FROM Events e, Subscriptions s
>            JOIN SubscriptionDeviceMappings m where m.SubscriptionId = 
>s.SubscriptionId
>WHERE ...
>
>If the SubscriptionDeviceMappings table has multiple rows for each 
>SubscriptionId, you'll end up with multiple notification rows.
>
>You'll have to maintain the SubscriptionDeviceMappings table in your 
>subscription management code, but that's really not different to keeping the 
>device name in the subscription itself, which is a very common practice.
>
>Hope this helps.
>-shyam

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