Notification on update

  • Could someone point me to tutorial (or outline the steps for me) on how to do the following:

    • I have an insert record form (aspx C#) based on sql server 2000 table
    • On insert of a new record, I want to trigger a notification to certain people that a new record has been added.

     

  • Creating a trigger is simple and if you check sql books on line you will see plenty of examples.

    To send the mail I would use xp_sendmail. Again check bol for some examples.

    You have to ensure that sql server agent is configured to sendmail and the account it runs under has the correct priveleges if you have not sent mail before.

    Give it a try and come back if you come across any problems you cannot fix.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Sending mail from a trigger is not recommended.  Triggers should be performed quickly since other things wait for completion of the trigger.  Sending mail is slow and frought with problems.  One solution would be to have the trigger write to a table and then having a SQL server agent job that checks the table periodically and sends the email if it finds any entries.

    Terri



    Terri

    To speak algebraically, Mr. M. is execrable, but Mr. C. is
    (x+1)-ecrable.
    Edgar Allan Poe
    [Discussing fellow writers Cornelius Mathews and William Ellery Channing.]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply