How can I do this?

  • I have a request table. This table holds requests to add roles, delete roles, add a user, etc.

    What I want to happen is that when a request is made, I want to notify someone via email that a request has been made and they need to go and look at it.

    However, if I put a trigger on this table, they could potentially get hundreds of emails a day. For example, if there is a request to add Bob as a user and give him abc_role and xyz_role, that would generate 3 emails. I would only want to generate 1 email to let the user know that there are new requests for Bob that he needs to look at.

    Can anyone think of a way to do this?

  • Write a stored procedure that queries the table and aggregates requests for each user and generates one e-mail. Schedule the stored procedure to run at a set interval or your choice, every 15-30 minutes.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

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

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