Current executing procedure name

前端 未结 5 1242
情歌与酒
情歌与酒 2020-12-23 15:57

Is it possible to get the name of the current Stored Procedure in MS SQL Server?

Maybe there is a system variable or function like GETDATE()?

5条回答
  •  半阙折子戏
    2020-12-23 16:28

    You may try this:

    SELECT OBJECT_NAME(@@PROCID)
    

    Update: This command is still valid on SQL Server 2016.

提交回复
热议问题