Tuesday, February 6, 2018

List Stored Procedure Modified and Created in Last N Days


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

SELECT 
nameFROM sys.objectsWHERE type 'P'AND DATEDIFF(D,modify_dateGETDATE()) < 10
----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 nameFROM sys.objectsWHERE type 'P'AND DATEDIFF(D,create_dateGETDATE()) < 10
----Change 7 to any other day value.

No comments :

Post a Comment