Friday, February 24, 2012

Getting events upon DB changes (NOT SCHEDULED)

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 !

I posted an response over in the newsgroups.

http://groups.google.co.il/group/microsoft.public.sqlserver.notificationsvcs/browse_thread/thread/95afce139ab9ffa1/26e0ccda6b6c4921?hl=en#26e0ccda6b6c4921

Joe|||

Joe

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

|||HostedProviders work within and are subject to the NS service. NonHostedProviders work outside that service. So in this case, you'll want to declare a NonHostedProvider.

HTH...

Joe

No comments:

Post a Comment