I use MSSQL Management Studio 2005 Express Edition, and I have more than 100 stored procedures. How create sql-script which contain only stored procedures? Thanks.
4 Answers
Right click on the database -> Tasks -> Generate Scripts -> Go through the steps -> There are check boxes to select Tables, SPs, UDFs and Users. Select only SPs and create the script.
Here is the starting point.

1 Comment
If you do exec SP_HelpText StoredProcedureNameGoesHere, you will get the full script of that procedure.
Do this to get 5 procedures (you get the picture)
exec SP_HelpText StoredProcedure01
exec SP_HelpText StoredProcedure02
exec SP_HelpText StoredProcedure03
exec SP_HelpText StoredProcedure04
exec SP_HelpText StoredProcedure05
Here's a script to generate the script for all procedures in your db.
SELECT 'Exec sp_Helptext ' + SPECIFIC_NAME
FROM INFORMATION_SCHEMA.Routines
Comments
Open Databases >> DBName >> Programability >> Stored Procedures in Object Explorer Details and then select all procedures except "System Stored Procedures" folder and right click on it and select "Script Stored Procedures as >> Create To >>" option.

