Is there a way to find out when the last time a stored proc was used? Or if
it has ever been used?
David,
I'm not aware of any meta data field that tracks the last use of a stored
procedure. You can determine the creation date by using sysobjects table.
Profiler can be used to track the use of individual stored procedure. A
less impact option for infrequently used procs would be to insert a DEFAULT
VALUES record into a custom audit table i.e., SUSER_SNAME(), GETDATE(),
et.al. as part of the proc execution. In addition there are several
third-party auditing software packages available.
HTH
Jerry
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:A748264D-FF0D-43F2-94B8-F15ABFD5AE0F@.microsoft.com...
> Is there a way to find out when the last time a stored proc was used? Or
> if
> it has ever been used?
|||Hi,
No, By itself sql server will not store these information. You can set a
filter in profiler and redirect the log to a file.
Later you can open the file and look into the times SP is executed.
Thanks
Hari
SQL Server MVP
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:A748264D-FF0D-43F2-94B8-F15ABFD5AE0F@.microsoft.com...
> Is there a way to find out when the last time a stored proc was used? Or
> if
> it has ever been used?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment