Returns the stored procedure ID of the current procedure.
@@PROCID
integer
This example creates a procedure that uses SELECT to display the @@PROCID setting from inside the procedure.
CREATE PROCEDURE testprocedure AS
SELECT @@PROCID AS 'ProcID'
GO
EXEC testprocedure
GO
CREATE PROCEDURE | Metadata Functions |