November 24, 2020 at 6:03 pm
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?
November 24, 2020 at 7:03 pm
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".
November 24, 2020 at 7:29 pm
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.
November 24, 2020 at 8:49 pm
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