I am working on sqlserver 2005 and recently started facing a problem of unexpected changes in database tables.
I have an employee table with a datetime column which holds date of birth of all the associates.
Recently i the DOB of the employees is getting changed and when i enquired ...... everyone says that they have not touched the database neither from the UI or from backend.
This is being happening since 4 months and am not able to know what exactly is happening on DB
Thought of writing triggers but dont know how to capture the values which i have mentioned.
Thanks in advance Usha
A trigger would certainly help here. You could use an 'instead of' trigger to avoid the update and keep the data untouched or use an 'after' trigger Take some action after the update has been made.No example at the moment as I am on my phone.
answered Mar 03 '11 at 11:23 PM
If you are on SQL Server 08 and above (E.Edition or Dev Edition) you can use Auditing. or you can use custom audit triggers for that table capturing username and other details. Refer [this] simple blog for audit trigger.: h ttp://weblogs.asp.net/jgalloway/archive/2008/01/27/adding-simple-trigger-based-auditing-to-your-sql-server-database.aspx
answered Mar 03 '11 at 11:39 PM