• subscribe
June 26, 2002 12:00 AM

Retrieving a Database’s Stored Procedures and Change Dates

SQL Server Pro
InstantDoc ID #25297

In SQL Server 2000, how can I list a database's stored procedures and their change dates?

The data you're looking for is stored in SQL Server 2000's system tables. Because Microsoft discourages users from querying the system tables directly (the tables change from release to release), we recommend that you retrieve this information from the ANSI-standard information schema views for each database. The following statement uses an information schema view to return the data you want:



USE   -- The database that holds 
  -- the stored procedures and functions.
GO
SELECT specific_catalog, specific_schema, routine_type,
 routine_name, created,
FROM INFORMATION_SCHEMA.ROUTINES
ORDER BY 1 asc, 2 asc, 3 asc, 4 asc

Note that SQL Server retains only the created date for stored procedures, so to capture the date of the latest version, you need to drop, then create the procedure instead of using ALTER to modify or update the procedure.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...