Find when a stored procedure or function was last altered
Find when a SQL Server stored procedure or function was last altered with this script.
Find when a SQL Server stored procedure or function was last altered with this script.
SELECT specific_catalog, specific_schema, routine_type, routine_name, created,last_altered FROM INFORMATION_SCHEMA.ROUTINES ORDER BY 1 asc, 2 asc, 3 asc, 4 asc
Reader Feedback
Andrew B writes: This tip is incorrect. There is no way to see when a stored procedure was altered. If you look at the source code to the view you will notice it returns the same data for CREATED and LAST_ALTERED -- see the following:
CREATED = o.crdate, LAST_ALTERED = o.crdate
For More Information
- Feedback: E-mail the editor with your thoughts about this tip.
- More tips: Hundreds of free SQL Server tips and scripts.
- Tip contest: Have a SQL Server tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize -- submit your tip today!
- Ask the Experts: Our SQL, database design, Oracle, SQL Server, DB2, relational model, and data warehousing gurus are waiting to answer your toughest questions.
- Forums: Ask your technical SQL Server questions--or help out your peers by answering them--in our active forums.
- Best Web Links: SQL Server tips, tutorials, and scripts from around the Web.