Wednesday, March 21, 2012

Last Select Statement

Any ideas how I can find out when was the last update/select made in a database in SQL Server? Even if I can find any user login information, that would be useful too.

Regards,

Bala

With the SQL Server Profiler tool, you can monitor querying activity, including who's running the query. But you only get that information when it's running... I don't know of a general activity log SQL Server keeps that you could study.

-Ryan / Kardax

|||

You could try using Lumigent's Log Explorer or Red-Gate's Log Rescue, however these will not help with tracking SELECT statements but will help track modifications to the database's data or structure:

http://www.lumigent.com/products/le_sql.html

http://www.red-gate.com/products/SQL_Log_Rescue/index.htm

Note that the ability to obtain such information from a database's log file is dependent on both the database's recovery model and when the last log backup was taken (if appropriate).

Chris

No comments:

Post a Comment