Share via


last_user_update is null

Question

Friday, August 11, 2017 9:13 AM

In one of my table last_user_update is null. what should I believe in this case? For other tables, it is showing updated date.

Can you please suggest?

Here is the query I am using to know about when was the last update/insert on tables.

SELECT OBJECT_NAME(OBJECT_ID) AS tablebaseName, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'DBname')
AND OBJECT_ID=OBJECT_ID  ('Tablename')

All replies (6)

Saturday, August 12, 2017 10:34 AM ✅Answered

Look at index_id 0 or 1 (for heap and clustered index). They will always have a value - if the table has been updated since last time the server was restarted. (Or the DMV was cleared manually, which I think it it can.)


Monday, August 14, 2017 6:59 AM ✅Answered

>>>So, we can get a confirmation that there are no updates on that table since the >>>ast server restart.

Yes and also there is NO inserts as well

Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence


Friday, August 11, 2017 9:36 PM

That would suggest that since the server started, there has been no update that affects that index.


Saturday, August 12, 2017 9:56 AM

Thanks for the suggestion.But if a user has done some changes on another column which doesn't have index then how to check the latest update of that table.We don't have any auditing option available on that table.


Monday, August 14, 2017 6:50 AM

Thanks.I have checked at index_id 0 and 1 and they also have the last_user_update value is Null.

So, we can get a confirmation that there are no updates on that table since the last server restart.

Please correct me if I am wrong.


Monday, August 14, 2017 7:26 AM

Thank you so much.