Just Code‎ > ‎

SQL - Extract all user created Stored procedure text from syscomments

posted May 31, 2011, 5:11 AM by Peter Henell

SELECT text
FROM sysobjects so
CROSS APPLY
(
    SELECT text 
    FROM syscomments 
    WHERE id = (SELECT id FROM sysobjects WHERE name = so.name) 

) sps
WHERE type = 'P' AND category = 0 ORDER BY name
Comments