Dec 7, 2014

Script to get the current stored procedure definition inside stored procedure

We can get the current or running stored procedure "create script" inside the stored procedure by below script:

SELECT OBJECT_DEFINITION(@@PROCID) AS ProcScript


Above script will also work for user defined SQL function and triggers. 

No comments:

Post a Comment