Last active
June 17, 2016 12:48
-
-
Save csprofile/8a518ee815bfff15e0eea4e767fe83af to your computer and use it in GitHub Desktop.
Return table with all called stored procedures from a SP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SPName NVARCHAR(MAX) = 'SPName' | |
DECLARE @T TABLE (T VARCHAR(MAX)) | |
INSERT INTO @T | |
EXEC SP_HELPTEXT @SPName | |
SELECT LTRIM(REPLACE(T,' ','')) | |
FROM @T | |
WHERE T LIKE '%EXEC%' | |
AND T NOT LIKE '%xp_logevent%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment