Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create date of store procedure

Status
Not open for further replies.

DEBUINFO4GL

Programmer
Nov 12, 2003
3
SG
How I find out the create date of particular store procedure in database?
 
Hi Debu,

Database server does not store the date on which a stored procedure has been registered or compiled. It is strongly recommended to use the DOCUMENT keyword available in the SPL to store all documentation related information specific to a procedure along with creation and subsequent modified dates. The SQL below lists document contents of your stored procedure, if any:

select procname, seqno, data
from sysprocedures p, sysprocbody b
where p.procid=b.procid and datakey='D'
order by procname, seqno ;

A Stored Procedure is parsed & optimized when compiled, and an execution plan is stored in binary format in one of the catalog table. Sysprocplan stores these information along with plan created date. The plan gets updated if underlying objects has been changed or a DBA issues an UPDATE STATISTICS FOR PROCEDURE statement. Assuming that you have not updated the statistics, and no changes have been taken place in connected objects, the SQL below will give you the date of creation of the procedure or plan updated date whichever is very recent.

select unique p.procname, created
from sysprocedures p, sysprocplan l
where p.procid=l.procid ;

Regards,
Shriyan
"When you dial a wrong number, you never get a busy signal."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top