SQL Server: is it possible to get procedure or table creation and last alter date?
If it is then how do to it?
SQL Server 2005
SQL Server: is it possible to get procedure or table creation and last alter date?
If it is then how do to it?
SQL Server 2005
Sure:
SELECT name, create_date, modify_date
FROM sys.tables
SELECT name, create_date, modify_date
FROM sys.procedures
The system catalog views in the sys
schema are present in SQL Server 2005 and up, and provide a wealth of (metadata) information about the database objects.
Check out the MSDN / SQL Server Books Online docs on Querying the SQL Server System Catalog for a lot more details and information.
If you want to take things to the next level and implement a custom schema change tracking solution you can do so by using DDL Triggers.
Take a look at Using DDL Triggers in SQL Server 2005
It is common to use such techniques in order to record what has changed and to even block/rollback changes of an undesirable nature.