Is there any way within a stored procedure for it to reference its own name? Say I want it to print its own name, but without hard-coding the name in the stored procedure. Is there any cheater way to get the name or id from within the procedure itself without using the actual name to find the information?
Share
Try:
@@PROCID returns the object ID of the current SQL module. OBJECT_NAME translates an object ID to its name. Both are available from at least version 7 to 2008 of SQL Server.