views:

14

answers:

0

I have created a trigger that looks for an specific code event and delete it; but since I am no expert in triggers I want to know if the below trigger may have bad performance implications. Thanks

  ALTER TRIGGER deleteSpecificEventCode
    ON dbo.aspnet_WebEvent_Events
    FOR  INSERT
    AS

    DECLARE @DELETECODE INT
    SET @DELETECODE = 3008 

    if (SELECT EventCode FROM Inserted) = @DELETECODE
    BEGIN
        delete aspnet_WebEvent_Events where EventId=(SELECT EventId FROM Inserted)
    END

By the way, the code I want to delete is 3008 = someone is trying to inject html tags in a comments area I have. I'm not able to reproduce the error in development area but in the real life is happening and its making my data base grow real fast. Any suggestions besides the trigger I create. Thanks