Forum Discussion

AmitGhotikar's avatar
AmitGhotikar
Copper Contributor
Feb 28, 2022

How to get last updated date of the table

Hello Experts,

 

I am looking for the date,  when is the last update (delete, truncate and reinsert) was made on the table

 

I came across  SYS.DM_DB_INDEX_USAGE_STATS table with LAST_USER_UPDATE column, but sometime it returns NULL, Shall I believe on it gives me what I am looking for 

 

Regards,

Amit

5 Replies

  • trkrishnan's avatar
    trkrishnan
    Copper Contributor
    I m looking for similar information of finding the last updated date time of a SQL Server table . If any one knows how to do it , please share
  • lijetcart's avatar
    lijetcart
    Copper Contributor

    AmitGhotikar 

    there is a good tools you can find out,easy to know createtime/updatetime

    and it can support sqlserver

     

    https://www.grapecity.com.cn/solutions/huozige

  • olafhelper's avatar
    olafhelper
    Bronze Contributor

    AmitGhotikar , Stats are not persisted, they returns only values for the runtime. Of SQL Server restart all stats get cleared, so the are not very reliable.

    What are you looking for/trying to achieve here?

    truncate 

    TRUNCATE is more a DDL (drop+recreate table) then a DML command.

    • trkrishnan's avatar
      trkrishnan
      Copper Contributor
      olafhelper I m trying to find the last updated time of a table stored in SQL server. Please let me know how to get it . This is required to show the last updated time of a table in a separate UI dashboard as well as further processing in our data pipeline to check for duplicate records across multiple tables.

Resources