Last SQL Server Database Update

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

I want to know the last updated time for changes made to the database metadata, not the actual data inside the table. In particular, when:

  • Any new table is created / deleted from the database.
  • Any new column is added / removed from the table in the database.
  • Any new views / stored procedures / functions are added / modified inside the database.
+6
source share
2 answers

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

select * from sys.objects order by modify_date desc 
+14
source

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

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

Source: https://habr.com/ru/post/984888/


All Articles