Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to tell the last change date of a stored proc?

Author  Topic 

stonebreaker
Yak Posting Veteran

92 Posts

Posted - 2008-01-21 : 11:47:30
Is there someplace in the database I could check to see when the last time a stored proc was altered?

Thanks in advance.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-01-21 : 12:56:41

Maybe this helps.

If stored procedure was created but never modified afterwards modified date and create date for that stored procedure are same.

SELECT name
FROM sys.objects
WHERE type = 'P'
AND DATEDIFF(D,modify_date, GETDATE()) < 7 --Change 7 to any other day value.Following script will provide name of all the stored procedure which were created in last 7 days, they may or may not be modified after that.

SELECT name
FROM sys.objects
WHERE type = 'P'
AND DATEDIFF(D,create_date, GETDATE()) < 7 --Change 7 to any other day value
Go to Top of Page

stonebreaker
Yak Posting Veteran

92 Posts

Posted - 2008-01-21 : 13:49:46
Exactly what I needed, thank you very much!
Go to Top of Page
   

- Advertisement -