SQL Server row date last modified

前端 未结 6 589
说谎
说谎 2021-01-07 16:09

A colleague of mine says that SQL Server saves the date and time of last modification in a \"hidden column\" in each record. I am pretty sure that he said something wrong. C

6条回答
  •  误落风尘
    2021-01-07 16:47

    From Pinal Dave, there is a DMV that you can use to get this information. Your colleague might be referring to the TIMESTAMP for a modified row, but as far as I know it only maintains that if you ask it to by explicitly adding a column of that type.

    SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*
    FROM sys.dm_db_index_usage_stats
    WHERE database_id = DB_ID( 'AdventureWorks')
    AND OBJECT_ID=OBJECT_ID('test');
    

提交回复
热议问题