SQL Server: Knowing Stored Procedure Modification

Following Commands helps in Knowing:

1.    Which Stored procedure is modified in last 7 days?

2.    Which Stored Procedure is created in last 7 days?

3.    Names of all the Stored Procedure Created in last 7 days.

--to know which SP modified in last 7 days:

 

SELECT name

FROM sys.objects

WHERE type = 'P'

AND DATEDIFF(D,modify_date, GETDATE()) < 7

 

--to know which SP created in last 7 days modify above query by replacing modify_date with create_date

 

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.

 

Ebook Download
View all
Learn
View all
F11Research & Development, LLC