How to Find when the Table was last updated by a user in SQL Server
SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, Last_User_Update,*
FROM sys.dm_db_Index_Usage_Stats
WHERE Database_Id = DB_ID( 'TAMATAM') --Database name need to pass here
And Object_Id=Object_Id('TBL_Weekly_Data') --Table name need to pass here
SELECT Distinct Last_User_Update
FROM sys.dm_db_Index_Usage_Stats
WHERE Object_id=Object_id('[dbo].[TBL_Weekly_Data]')
SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, Last_User_Update,*
FROM sys.dm_db_Index_Usage_Stats
WHERE Database_Id = DB_ID( 'TAMATAM') --Database name need to pass here
And Object_Id=Object_Id('TBL_Weekly_Data') --Table name need to pass here
--------------------------------------------------------------------------------------------------------
SELECT Distinct Last_User_Update
FROM sys.dm_db_Index_Usage_Stats
WHERE Object_id=Object_id('[dbo].[TBL_Weekly_Data]')
--------------------------------------------------------------------------------------------------------
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.