Quantcast
Channel: Active questions tagged audit - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 168

Loop through all tables and detect changed rows using checksum or hashbytes

$
0
0

All the tables have an extra row called checksum which is stored by doing INSERT INTO example_table VALUES ('a','b', BINARY_CHECKSUM('a','b')).

Suppose someone change a row value, obviously the checksum will change, and when I run Select CHECKSUM_AGG(*) FROM example_table, that value will differ from the stored checksum.How can I detect, looping through all tables, what row or table was changed?Can I do this with a Stored Procedure? This is an SQL SERVER database.


Viewing all articles
Browse latest Browse all 168

Trending Articles