A
AMDRIT
couldn't find a group just for SQL Server. Anyone know if it is possible
to retrieve the name of the stored procedure that is currently executing?
What I would like to do is record usage in a table everytime a stored proc
is executed.
create procedure blahblah
as
--Update Usage Log
-- optionally test to see if monitoring is on (custom run time variable?)
-- figure out how to get storedproc's name
insert into usagelog (OwnerName, StoredProcName, UsageDate) values
(CurrentProcedureOwner, CurrentProcedureName, GetDate())
--Complete stored procedure
Select * from myblahblahtable
to retrieve the name of the stored procedure that is currently executing?
What I would like to do is record usage in a table everytime a stored proc
is executed.
create procedure blahblah
as
--Update Usage Log
-- optionally test to see if monitoring is on (custom run time variable?)
-- figure out how to get storedproc's name
insert into usagelog (OwnerName, StoredProcName, UsageDate) values
(CurrentProcedureOwner, CurrentProcedureName, GetDate())
--Complete stored procedure
Select * from myblahblahtable