How to identify particular table value is modified when?

Easwaran Paramasivam
Easwaran Paramasivam used Ask the Experts™
on
Hi Experts,

 I've table called tBalance. For Player id 1040 the value IsVoid was 1 intially. Someone has updated this values as 0. How to ensure the customer that it was preiously one and now it is zero?

  Kindly advice.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Project Leader
Commented:
Hello,

If you do not have an earlier backup of the database where the value was 1 and if you are not maintaining an audit table for the changes, then the only solution may be to read from the transaction log (if you have NOT TRUNCATED the log after the update). If the log was cleared after the update was made, I doubt there may not be any way out.

Here is a blog that details how to read from transaction log.
http://raresql.com/2011/10/22/how-to-recover-deleted-data-from-sql-sever/

-Harish
lcohanDatabase Analyst
Commented:
My suggestion is to create a "audit" table if this is needed for any changed record and put a trigger on the parent OLTP table to populate the "Audit" table with all relevant info - who/when modified it, and what action - insert/update or delete?
The audit could implement now. But the question with the existing modified table which did not implement it. Is there no other way to track it?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Harish VargheseProject Leader

Commented:
Did you try reading from the transaction log? If the update had happened prior to last database backup, you may have to read from the transaction log of from the backup.

-Harish
Monica PSoftware Developer

Commented:
To track the updates what i have used is ..

This in case if update is made from website :

I have written the function in .net code to track the logged user and his action (insert,update,delete) into another table...Using that table i can view the Action performed by that user.

to Track all updates  in that table .,
you can also  use trigger to write  a log in another table.,  to track the person & operation he done.

I not know this solution is best...just shared  my view...
Not sure about how you will find earlier changes made in SQL server.
But if you have Change Data Capture enabled, you could have better chance to track all the changes made in SQL.
Also, check this MS-Library.
A good resource you can also explore here for further assistance.
Top Expert 2012

Commented:
Is there no other way to track it?
No.
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial