Notify my WCF service when updating my database

I have a WCF service that should notify clients when a database change occurs (sql server 2005). This is fairly easy to do if I find a way to notify my services of any changes. Maybe I can create a database trigger in the table and run this trigger with a small service client that notifies my service, but I wonder if there is a better way to do this? It would be a viable solution to poll the database of service changes, but I'm not sure if this is the best way (and a sendign notification would be preferable for my service).

Since the corresponding updates apply only to a specific part of the database, I was also wondering if such a trigger (or other mechanism) can be associated with a database diagram.

All help is appreciated! rinze

+6
sql triggers sql-server-2005 wcf notifications
source share
2 answers

If your database is SQL Server 2005 and above, you can try this solution: Remove the pool to modify data from the front end of WCF .

As a side note, never call external processes from a trigger, never make web calls from a trigger. It is a guaranteed recipe for disaster.

Update

For those who are interested in mixing query notifications with LINQ to SQL, I recommend Using SQLDependency objects with LINQ .

+6
source share
+1
source share

All Articles