I have a table named Stored_Procedure_Logging
where I store the logging of my stored procedure.
SPD_name Start_process End_process
SPD_MySpd 2015-04-09 18:06:50 NULL
The first script will insert the Start time by this way :
INSERT INTO Stored_Procedure_Logging (Start_process,SPD_name)
VALUES (GETDATE(),OBJECT_NAME(@@PROCID))
And when the SDP finish its run I must update the previous inserted record with the End time with this below script but it does not working !!
I find a NULL value in the second column (End_process)
UPDATE Stored_Procedure_Logging
SET End_process = GETDATE()
WHERE SPD_name =OBJECT_NAME(@@PROCID)
OBJECT_NAME(@@PROCID)
is to get the current SPD
Can you help me please ??