Declaring a cursor with all the sp names, and then execute sp_helptext for each one.
DECLARE @sp-2 AS SYSNAME
DECLARE curSP CURSOR LOCAL FOR
SELECT name
FROM sysobjects
WHERE xtype = 'P'
ORDER BY NAME
OPEN curSP
FETCH NEXT FROM curSP INTO @sp-2
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT 'Scripting sp ' + @sp-2 + '...'
EXEC ('EXEC sp_helptext ' + @sp-2)
FETCH NEXT FROM curSP INTO @sp-2
END
CLOSE CurSp
DEALLOCATE curSP