List all stored procedure created / modified in N days

Jun 28, 2010 Posted by Lara Kannan
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.

Following script will provide name of all the stored procedure which were MODIFIED in last 7 days, they may or may not be modified after that.

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

Source : http://blog.sqlauthority.com/

Hope this script will help you.

Share

Post a Comment