all groups > sql server notification services > may 2005 >
You're in the

sql server notification services

group:

Events vs CurrentEvents



Events vs CurrentEvents tarpan
5/20/2005 11:28:28 AM
sql server notification services: Hi,

I have started with using Events table (EventRule selects the data from
table names EventName_Events). As a result every time when a event occurs I
receive the notification + notifications about ALL the events already handled
early.

When I switched to CurrentEvents table (Current_EventName_Events) and
everything seems to work just fine.

However the samples teach to use the Events table. Am I doing something wrong?

Example (Look in FROM section):

This Code gives the multiple notifications
====================
SELECT dbo.NS_Bin_Level_InfoNotify(s.SubscriberId,
s.DeviceName,
s.SubscriberLocale,
B.bin_pk)
FROM NSBin_Level_EVEvents e, NSBin_Level_SUBSubscriptions s,
Inventory2FDemo..Bins B
WHERE e.Bin_pk = B.Bin_pk and (s.Bin_PK = e.Bin_PK or s.Bin_PK is Null)
====================

This Code works fine
====================
SELECT dbo.NS_Bin_Level_InfoNotify(s.SubscriberId,
s.DeviceName,
s.SubscriberLocale,
B.bin_pk)
FROM NSCurrentBin_Level_EVEvents e, NSBin_Level_SUBSubscriptions s,
Inventory2FDemo..Bins B
WHERE e.Bin_pk = B.Bin_pk and (s.Bin_PK = e.Bin_PK or s.Bin_PK is Null)
====================

Re: Events vs CurrentEvents Shyam Pather [MSFT]
5/20/2005 1:46:37 PM
You're not supposed to select from either the events or the current events
tables. Rather, you should select from the events view, which has the same
name as the event class. NS ensures that the view always contains only the
"current" events for the period at which your rule is executed.
-shyam

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
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
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Events vs CurrentEvents Joe Webb
5/20/2005 2:31:58 PM

Hi Tarpan -

When the generator fires, SQLNS sets up a couple of views to assist
with the matching of subscription data and event data. It's those
views that you want to use in your match rule, not the underlying
tables themselves.

The event view is given the same name as the event class name.
Similarly the subscription view is named for the subscription class.

So, you need to change your ADF, replacing the table names in the FROM
clause with the class name for your event and subscription classes.

HTH...


--
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 Fri, 20 May 2005 11:28:28 -0700, tarpan
[quoted text, click to view]
AddThis Social Bookmark Button