July 15, 2014 at 11:11 pm
Good day. Tell me how to calculate the tables in which, for example, there is a record for the last 20-30 minutes? The database consists of tables, functions, triggers, and ensures that itd program for the design of complex and large objects, such as plants.
July 16, 2014 at 12:00 am
gurbanov.1984 (7/15/2014)
Good day. Tell me how to calculate the tables in which, for example, there is a record for the last 20-30 minutes? The database consists of tables, functions, triggers, and ensures that itd program for the design of complex and large objects, such as plants.
The "best" way (IMHO) is to have a properly maintained/populated ModifiedDate column as a DATETIME data-type. Other than that and provided that the tables have clustered indexes, you could check sys.dm_db_index_usage_stats and get the last dates/times out of that. In particular, the "user_updates" column from that view is defined in BOL as...
The user_updates counter indicates the level of maintenance on the index caused by insert, update, or delete operations on the underlying table or view.
... so keep in mind that it would be just new rows from INSERTs.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply