Re: Database events - notify an application

From: lindawie (lindawie_at_my-deja.com)
Date: 03/11/04


Date: Wed, 10 Mar 2004 19:42:47 -0800

Mike,

> I have an application that polls the db every few seconds to
> refresh the data. Would like to change so that the db sends a
> message to my app when something interesting happens
> (insert/update etc.).
>
> I've looked into sp_addmessage, raiseevent etc, but it seems
> limited to pager, email and net send. I don't think I want to do
> net send as it may be disabled and don't want to trap all net
> send messages on the client.
>
> So I was thinking of writing and extended sp that, say, would
> send a message via udp, this xp would get called via triggers.
>
> Am I on the right track, or are their smarter ways to do this?
> sql server 2000.

You could look at Notification Services:

http://www.microsoft.com/sql/ns/default.asp

Or you could write a simple console application that notifies your
application when something interesting happens. Create a SQL Server
Agent job to run the notifier. Execute sp_start_job in your triggers
to run the notifier asynchronously so it will not impact your
database transaction.

Linda



Relevant Pages

  • Re: Whats wrong with triggers?
    ... On the Microsoft SQL Server platform triggers offer an extremely powerful ... > (via a PC app) and writes it to a database. ... > processed using triggers and stored procs and replicated to a central ...
    (comp.databases)
  • Whats wrong with triggers?
    ... I recently saw a comment by CELKO regarding SQL Triggers that advised ... I'd have to write an app to poll the database every ... MS SQL Server 2000 Desktop Edition at 3 remote data ...
    (comp.databases)
  • .NET Web app database
    ... She created a .NET web ... app in VB.NET and SQL Server 2000. ... I can't find the database the app is trying to ... All the SQL is embedded into stored procs, triggers etc. ...
    (microsoft.public.dotnet.framework.aspnet)