How can one determine the last time when records have been inserted,
updated or deleted for a table?
Thanks.Hi
Tony has posted this sometime ago
In SQL Server 2005 you can use the sys.dm_db_index_usage_stats data
management view, look at the column last_user_update, you can also see when
the table was last accessed (last_user_seek and last_user_scan - do a MAX on
them).
select *
from sys.dm_db_index_usage_stats
where database_id = db_id( 'readpasttest' )
<Wing9897@.hotmail.com> wrote in message
news:1190639143.805215.112750@.d55g2000hsg.googlegroups.com...
> How can one determine the last time when records have been inserted,
> updated or deleted for a table?
> Thanks.
>|||Wing,
The sys.dm_db_index_usage_stats is very helpful in an ongoing operational
period, e.g. answering questions such as whether the table had been updated
in the last hour.
However, if you have tables that are only updated rarely such as every few
weeks or month, this is probably not the answer for you. These counters are
initialized to empty whenever SQL Server service is restarted. Also, a
database detach or Auto-close removes the rows for that database.
RLF
<Wing9897@.hotmail.com> wrote in message
news:1190639143.805215.112750@.d55g2000hsg.googlegroups.com...
> How can one determine the last time when records have been inserted,
> updated or deleted for a table?
> Thanks.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment