Is there a way to find out from system tables when the store procedure was changed last?
by Ari Weil
Absolutely. You can use the sys.objects view to determine the create_date and modify_date for an object. The query would be:
select [name],[create_date],[modify_date]
from [sys].[objects]
where [type]=N'P' and [is_ms_shipped]=0
To see the full definition of the procedure you would run:
select [name],[create_date],[modify_date],[definition]
from [sys].[objects] obj
join [sys].[sql_modules] mod
on obj.[object_id]=mod.[object_id]
where [type]=N'P' and [is_ms_shipped]=0
August 29th, 2008 at 1:50 pm
Make sure to use ALTER PROCEDURE instead of DROP PROC/CREATE PROC when updating your procedures or you will reset the object id for the stored procedure and lose the original create date.