views:

396

answers:

3

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

A: 

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

shahkalpesh
That won't help after the fact.
Mitch Wheat
Agree with Mitch, this won't help.
Flair
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
@shahkalpeshUpdated. Thanks anyway.
Flair
+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.

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

Mitch Wheat
Thanks for your answer. But the output from "DBCC LOG" is quite unreadable, any method to help on this?
Flair
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