Get Create & Modify Dates for Routines

Posted: January 29, 2009 in SQL Server 2005

To check the date that a Procedure was modified, open a new query window and execute the following line of code:

-- Select all procedures from the database
SELECT   [name]        AS [ProcedureName]
        ,[create_date] AS [CreationDate]
        ,[modify_date] AS [ModificationDate]
        ,[type_desc]   AS [FunctionType]
FROM     [sys].[objects]
WHERE    [type_desc] LIKE '%PROCEDURE%'
ORDER BY [ModificationDate] DESC;

To check the date that a Function was modified, open a new query window and execute the following line of code:

-- Select all functions from the database
SELECT   [name]        AS [FunctionName]
        ,[create_date] AS [CreationDate]
        ,[modify_date] AS [ModificationDate]
        ,[type_desc]   AS [FunctionType]
FROM     [sys].[objects]
WHERE    [type_desc] LIKE '%FUNCTION%'
ORDER BY [ModificationDate] DESC;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s