how old is that usp in Windows?

We have a bunch of usp (user stored procedures), some of which are perfectly fine, and others are no longer used.  If y0u want to see when it was created, when it was last modified, and how long SINCE it was last modified, here is some code.

SELECT name
, create_date
, modify_date
, datediff(d, modify_date, getdate()) as [since_last_modification]
FROM sys.objects
WHERE type = 'P'
order by [since_last_modification] desc
Advertisements