Saturday, July 20, 2013

SQL Server -List of Procedure modified / created within specified date

Below is the SQL query which we can use to find out if any procedure has been modified recently in last 7 days or if any procedure has been created in last 7 days

Modified Procedure
use Northwind
select name
from sys.objects
where type='P' and DATEDIFF(D,modify_date,GETDATE())<7

Below is the result you would see





Created Procedure
select name,create_date
from sys.objects

where type='P' and DATEDIFF(d,create_date,GETDATE())<7


Hope this small tip would be beneficial for you in your coding. Till then enjoy !!