Some time we need to display to current or running stored procedure name in sql server. It is due to displaying error messages or to print some message. Problem with hard coded stored procedure name is that if procedure name has been changed then we will have t update the name each and every places. Best way we can do it by using meta data function.
Script to get the current or running stored procedure name inside stored procedure:
SELECT OBJECT_NAME(@@PROCID) AS ProcName