How to find recent sql update operations acting up

2019-08-18 05:11发布

say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.

3条回答
Luminary・发光体
2楼-- · 2019-08-18 05:20

You would need to use a Transaction Log reader tool. There are several free ones available as well as commercial offerings.

You could also try this undocumented command:

 DBCC LOG(<database name>[,{0|1|2|3|4}]).

If you're using SQL Server 2000, RedGate have a free tool called SQL Log Rescue.

EDIT: Documentation for DBC LOG: (1) (2)

查看更多
\"骚年 ilove
3楼-- · 2019-08-18 05:31

Please refer to SQL Docs & look for OUTPUT clause (that you can use with UPDATE/INSERT to get the affected records).

http://msdn.microsoft.com/en-us/library/ms177564.aspx

查看更多
Ridiculous、
4楼-- · 2019-08-18 05:32

SQL Server Profiler will allow you to track hits to the database in real time. You can set filters on a number of properties to ge the output you need.

查看更多
登录 后发表回答