SQL Server database last updated date time

你。 提交于 2019-12-04 10:36:59

问题


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 database rather than actual data inside the table. Particularly when:

  • Any new table is created/dropped from Database.
  • Any new column is added/removed from table in the Database.
  • Any new views/Stored Procedures/Functions are added/altered inside the Database.

回答1:


Look in sys.objects should be enough, try this query

 select * from sys.objects
order by modify_date desc



回答2:


This will return last modified date time + name of updated item + description what was updated (table, stored procedure, etc)

SELECT TOP 1 name, modify_date, type_desc
FROM  sys.objects
ORDER BY modify_date DESC


来源:https://stackoverflow.com/questions/29535074/sql-server-database-last-updated-date-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!