Event Notifications - Can these be set up to monitor for changes to table data?

  • Hello,

    I'm new to using Event Notifications, but it is my understanding that they can be helpful for monitoring a variety of different events.

    Can these also be used to help audit changes to table data?  For example, if someone were to add a new record to a table, or update an existing one?

  • No, you'd use table DML triggers to handle table modifications (DELETE  and/or INSERT and/or UPDATE).

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Alternate to triggers, but similar idea, you could implement CDC (change data capture).

    If the database table is for a custom-built app, you could also implement audit history like that on the application side or in the stored procedure that changes the data.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Thanks to both of you for confirming.  I'll take a closer look at CDC as a solution.

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

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