1
votes

Does snowflake have function which returns name of the current stored procedure like the following in SQL Server.

SELECT OBJECT_NAME(@@PROCID)

I am just trying to build a logging table to log all statements that are executed inside a stored procedure this is for monitoring purpose i.e. which statement within stored procedure failed and how long queries are taking to run. If Snowflake has something out-of-box OR a recommended way of doing it please share.

1

1 Answers

3
votes

Try this from within your stored procedure:

const procName = Object.keys(this)[0];

Also see this related post.