German
German

Reputation: 126

how to find an update on transaction log SQL Server

This canned software that allows users to update all fields from an article and the only audit I got is who modified a particular record, but no audit record about what fields.

There is a policy that nobody should change some fields.

I'll implement something for this not happening in the future.

My concern now is how to find these updates in the transaction log. I know those files exits, no idea how to access them, query them, etc.

Thanks

Upvotes: 0

Views: 4361

Answers (1)

wakasupi
wakasupi

Reputation: 52

You can use a query like the following: https://www.sqlshack.com/reading-sql-server-transaction-log/

SELECT
  [Transaction ID], [Current LSN], [Transaction Name], [Operation],  [Context],[AllocUnitName],[Begin Time],[End Time], [Transaction SID],
  [Num Elements] ,
  [RowLog Contents 0],
  [RowLog Contents 1],
  [RowLog Contents 2],
  [RowLog Contents 3]
 FROM fn_dblog (NULL, NULL)
 WHERE [Transaction ID] = (Select [Transaction ID] FROM fn_dblog (null,null) WHERE
[Transaction Name] = 'INSERT')

GO

Upvotes: 0

Related Questions