In SQL Server 2005 we can find out when table, view or stored procedure was last modified. This functionality was not available in previous versions of SQL server
--Store procedure last modified
SELECT * From information_schema.routines
--Stored modified within last 7 days
select DATEDIFF(d,LAST_ALTERED,GetDate()),* from information_schema.routines WHERE DATEDIFF(d,LAST_ALTERED,GetDate())<=7
--table last modified
SELECT [name], create_date, modify_date FROM sys.tables
--View last modified
SELECT [name], create_date,modify_date FROM sys.views
No comments:
Post a Comment