say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.
views:
396answers:
3
A:
Please refer to SQL Docs & look for OUTPUT clause (that you can use with UPDATE/INSERT to get the affected records).
shahkalpesh
2008-11-19 05:38:13
That won't help after the fact.
Mitch Wheat
2008-11-19 05:40:50
Agree with Mitch, this won't help.
Flair
2008-11-19 06:02:09
Maybe you should re-phrase the question to say UPDATE by any user (not necessarily the one which is executing UPDATE - which is what I assumed)
shahkalpesh
2008-11-19 08:42:49
@shahkalpeshUpdated. Thanks anyway.
Flair
2008-11-19 14:16:22
+2
A:
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.
Mitch Wheat
2008-11-19 05:40:24
Thanks for your answer. But the output from "DBCC LOG" is quite unreadable, any method to help on this?
Flair
2008-11-19 06:03:26
A:
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.
TGnat
2008-11-19 14:24:06