To read the article online, visit http://www.4GuysFromRolla.com/webtech/sqlguru/q083099-2.shtml

The SQL Guru Answers your Questions...


Today's question comes from Irete P.:

Hi,

I'd like to know the last date all of the tables in a database were updated. Is there some stored procedure I can use?

Thank You,
Irete P.

Irete,

Sort of. The sysobjects table contains the creation date of the table - a column called crdate, I believe.

But I'm guessing that you'd like to know the last date/time the *data* in the table was updated. Sorry, you'll have to do this manually by creating an INSERT/UPDATE trigger on the table that modifies the "last updated" date in another table - probably some sort of master "last updated" table that you've created.

You could also add a "last updated" column to every table and have a trigger update that. Then you could select the max value out of the column.

Sean


Article Information
Article Title: 4GuysFromRolla.com
Article Author: Scott Mitchell
Article URL: http://www.4GuysFromRolla.com/webtech/sqlguru/q083099-2.shtml


Copyright 2017 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers