when was database updated last?

  • I'm wondering if there is a way (outside of setting a trace and waiting for some activity) to tell when a particular database was most recently updated (ie, insert, update, delete).  Kind of an "activity history" sort of thing.

    Any suggestions would be appreciated.

    Thanks,

    Jim.

  • Hi Jim

    As far as I know, there is no 'date last updated' property for a database, so there is no straightforward solution to your question.

    The following thread may be of interest - it relates to viewing the contents of the transaction log, which would give you the info you need. But it costs extra money.

    http://qa.sqlservercentral.com/forums/shwmessage.aspx?forumid=9&messageid=132638

    Alternatively, if you just want to audit changes to certain tables or fields within a database, you could consider writing a trigger that fires on insert/update/delete and writes to a separate audit table.

    Regards

    Phil

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks, Phil.

    Your reference led me to the undocumented DBCC LOG command, which when used at a certain level (eg. DBCC log (database_name, type=3) displays some readable date information.

    It isn't very friendly to look at, but it is better than nothing!

    Cheers,

    Jim.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply