Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All


I want to show the modification made by the user to table data by showing old value with updated value , can any body tell me how can I achieve this


thx
Posted
Comments
R. Giskard Reventlov 4-Nov-11 4:40am    
What have you already tried for yourself? What has searching here and on Google found?

1 solution

Thats great idea to track log of modification or back up you old data for future use....

for achieving this you need to do like this...

1) first of all you need to add one table, that table will used for storing old value before it will be updated.....

Schema Like this...

ID,TABLENAME,COLUMNAME,RecordID,OLDVALUE,UPDATEDVALUE

//here Record ID means the primary key or id of your record

2) then create a trigger that will perform operation for backup your old data before modified that....

3) then you can use that backup data for for showing old value with updated value...

For more about trigger you can please refer this link...

how to check whether it is inserte or update or delete in how to check whether it is update or delete in sql server trigger..?[^]
 
Share this answer
 
v2
Comments
Code_seeker_ 4-Nov-11 5:29am    
tx tejas..
Tejas Vaishnav 4-Nov-11 5:37am    
Please rate my ans....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900