Setting Insert records alert

  • How do I create an sql script that that would inform me if the table I have created has more than the specified amount that I have set it to please. Thanx.

  • Can u explain in detail.

    "Keep Trying"

  • I am looking for an sql script that sends an alert if the table has more that 400 records please.

  • sel, you could try something like this

    CREATE TRIGGER tr_test_trigger

    ON YourTable

    FOR INSERT

    AS

    IF @@ROWCOUNT = 0 RETURN

    IF (SELECT COUNT(*) FROM YourTable) > = 400

    BEGIN

    Run your alert code here

    END

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • You could write the alert related code in a stored procedure if you are using a stored proc to insert data. BTW what sort of alert did you have in mind?

    "Keep Trying"

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

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