views:

206

answers:

2

hi *,

I need to trace changes on a record in database. I have some triggers on different tables that calls one stored procedure and this sp updates records in certain table (table1).

I will trace records in table1 to find when and from where data are changed.

Actually I use sybase 12.5 and I would know how to read LOG file by SQL query in sybase or sql server.

tanx :)

A: 

I don't think we can read transaction log using sql query unless there is some tools like Fog Light

As far as I know we can use DBCC command

DBCC LOG([,{0|1|2|3|4}])

0 - Basic Log Information (default)

1 - Lengthy Info

2 - Very Length Info

3 - Detailed

4 - Full

Also if this is gonna be permanent scenario, I would create a history table to audit update and delete changes. Hope I helped, sorry if I don't answer your question.

Tamil.SQL
tanx, ok this command gets some data from transaction log but its output is in hex and isn't helpful:(. I know that sql server keeps a version of data befor and after changed those. I want to read this data, from first to now.
Amir Borzoei
A: 

I think pretty much the only way to track changes is to write a trigger...

SergeyKazachenko