all groups > sql server notification services > february 2007 >
You're in the

sql server notification services

group:

Getting events upon DB changes (NOT SCHEDULED)


Getting events upon DB changes (NOT SCHEDULED) Elad Gov-Ari
2/1/2007 7:22:32 AM
sql server notification services:
Hi.

i'm trying to set an Event Provider that will provide me with events
when a specific data changes in a specific table in the DB.

I've noticed that the built-in SQL Provider polls the DB using a
schedule and that doesn't help me.

I'm thinking of implementing a customed event provider but I'm looking
for a way to get events upon DB changes without using an interval (a
continues event provider).

is there any way to do it OTHER THAN using a QueryNotification ?

if the best way is indeed using QueryNotification - is there a way of
using it with the notification services ? and if anyone had done it -
any documentation / code examples / links would be highly appreciated !

Thanks !


Re: Getting events upon DB changes (NOT SCHEDULED) Joe Webb
2/1/2007 9:45:04 AM
[quoted text, click to view]


What about creating a trigger in the table that you're getting your events
from. Have the trigger call the Event Submission Stored Procedures of NS.

Look up NSEventBeginBatch<EventClassName> in BOL.

HTH...


--
Joe Webb
SQL Server MVP
http://www.sqlns.com



Re: Getting events upon DB changes (NOT SCHEDULED) Elad Gov-Ari
2/6/2007 12:10:40 AM
Hi,

I have read the info about the NSEventBeginBatchEvent<ClassName>,
NSEventWriteEvent<ClassName> and the NSEventFlushBatchEvent<ClassName>

what I was thinking of doing is create a trigger on the table which i
want to monitor. This trigger should call to a SP that takes parameters
(the parameters are the event fields). The triggered SP should then call
the NSEvent<XXX>Batch SP's

However, when i want to define the Event Provider as a Hosted Provider
in the Providers section of the ADF file, it requiers an Assembly file.

I don't see the need of such an Assembly file since all events are
generated directly from the DB (by the SP called by the trigger).

should i just create an "empty" Class that implements the iEventProvider
interface but actually does nothing ?

help would be highly appreciated !

Best regards, Elad



Re: Getting events upon DB changes (NOT SCHEDULED) eqx
2/6/2007 7:04:00 AM
I have a similiar requirement would appreciate everyone's thoughts.

My main app runs under VB.Net 2005 and SqlServer 2000. I would develop the
NS app with a custom event providers feeding info from SqlServer 2000 to
SqlServer 2005 NS environment. For matched events, I require notfication in
my VB.Net 2005 / SqlServer2000 environment. A windows form notification as
well as recording the matched event in the Sql2000 db. Many users will be
running with unique and overlapping NS criteria. I will have many diverse
match criteria and will have "event tables".

To visualize, many users will be monitoring stock portfolios with unique and
overlapping stock names. Criteria will be stock price, share traded, %
change yesterday's closing price, % price change versus the last 30 days
average ...

From My research, Query Notification triggers any time the table is touched
(loss of event granularity). My app must respond the the Query Notification
be reading finding by fields within the table by some event code and
timestamp, which specific event NS matched.


Also, I read Microsoft recoomends Query Notifcation be limited to 10
concurrent tracking registrations. Is this limit to a specific table or
across all tables ?

- Eqx

[quoted text, click to view]
Re: Getting events upon DB changes (NOT SCHEDULED) Joe Webb
2/6/2007 7:07:49 AM
[quoted text, click to view]

We have two nearly identical threads going - one here in the groups and
one in the forums. Let's consolidate over in the forums. Here's a link.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1194360&SiteID=1&mode=1




--
Joe Webb
SQL Server MVP
http://www.sqlns.com



AddThis Social Bookmark Button