Wednesday, March 21, 2012

Database Events?

Wondering if it's possible to get an event from sql 2000. That is, instead
of polling every few seconds and refreshing my application, can I register
to receive notification of an update/insert etc?
Thanks,
Mikelookup sp_addalert in BOL. If you know the event ID, you can do this or you
can roll your own raiserrror
HTH
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Mike Hildner" <mhildner@.afweb.com> wrote in message
news:e9TeUY%23$DHA.1288@.TK2MSFTNGP10.phx.gbl...
> Wondering if it's possible to get an event from sql 2000. That is, instead
> of polling every few seconds and refreshing my application, can I register
> to receive notification of an update/insert etc?
> Thanks,
> Mike
>|||Hi,
1. Create a user defined message using sp_addmessage (Refer books online)
2. Create an alert using sp_add_alert (Refer books online) using the message
id create in step 1 3.
3. Create a Operator using sp_add_operator (Refer books online)
4. Create a notification using sp_add_notification(Refer books online) - It
can be Email, Netsend or Pager message
5. In the stored procedure just use RAISERROR (msgid, 16, 1) where ever
required. This will internally call the above 4 steps and send the alert.
Note:
Above steps can be created using Enterprise manager as well.
Thanks
Hari
MCDBA
"Mike Hildner" <mhildner@.afweb.com> wrote in message
news:e9TeUY#$DHA.1288@.TK2MSFTNGP10.phx.gbl...
> Wondering if it's possible to get an event from sql 2000. That is, instead
> of polling every few seconds and refreshing my application, can I register
> to receive notification of an update/insert etc?
> Thanks,
> Mike
>|||Thanks Hari and Ray, time for me to do some reading.
Regards,
Mike
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:uPrvsBCAEHA.624@.TK2MSFTNGP11.phx.gbl...
> Hi,
> 1. Create a user defined message using sp_addmessage (Refer books online)
> 2. Create an alert using sp_add_alert (Refer books online) using the
message
> id create in step 1 3.
> 3. Create a Operator using sp_add_operator (Refer books online)
> 4. Create a notification using sp_add_notification(Refer books online) -
It
> can be Email, Netsend or Pager message
> 5. In the stored procedure just use RAISERROR (msgid, 16, 1) where ever
> required. This will internally call the above 4 steps and send the alert.
> Note:
> Above steps can be created using Enterprise manager as well.
> Thanks
> Hari
> MCDBA
> "Mike Hildner" <mhildner@.afweb.com> wrote in message
> news:e9TeUY#$DHA.1288@.TK2MSFTNGP10.phx.gbl...
> > Wondering if it's possible to get an event from sql 2000. That is,
instead
> > of polling every few seconds and refreshing my application, can I
register
> > to receive notification of an update/insert etc?
> >
> > Thanks,
> > Mike
> >
> >
>

No comments:

Post a Comment