SQL Server database last updated date time

后端 未结 3 1739
北荒
北荒 2021-02-08 01:14

Is there any sql script to find out when the database in SQL server is last updated?

I want to know the last updated date time for the changes done on meta data of the

3条回答
  •  时光取名叫无心
    2021-02-08 01:18

    SELECT 
       [rs].[destination_database_name], 
       [rs].[restore_date], 
       [bs].[backup_start_date], 
       [bs].[backup_finish_date], 
       [bs].[database_name] as [source_database_name], 
       [bmf].[physical_device_name] as [backup_file_used_for_restore]
    FROM msdb..restorehistory rs
    INNER JOIN msdb..backupset bs ON [rs].[backup_set_id] = [bs].[backup_set_id]
    INNER JOIN msdb..backupmediafamily bmf ON [bs].[media_set_id] = [bmf].[media_set_id] 
    

提交回复
热议问题