I'm wondering if there is an automated way to script a large number of stored procedures to individual files, for later inclusion in a source safe project
Preferrably they would have the same name as the sp in the database.
In the sql 2005 studio, I can script them one by one, or a bunch of them to one file, but I can not see how to get them to individual files.
Thanks for any suggestions.
LT

SQL 2005 scripting stored procedures
RFaircloth
It is frustrating. MS has taken a step backward in the scripting of stored procedures. There is no obvious way to script the permission along with the code either.
Anatoly Stefanyuk
I do not test in SQL Server 2005 but SCPTXFR.EXE is a very good command line utility for it. It can be found in the C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade (SQL Server 2000) or x86\upgrade in SQL Server 2000 CD. It appears to be missing in SQL Server 2005 but....
More info.. http://www.norbtechnologies.com/pdf/Technical%20Article%20-%20How%20to%20Schedule%20a%20SQL%20Server%20Database%20Creation%20Script.pdf
regards
Nilton Pinheiro
www.mcdbabrasil.com.br (Portuguese)
Mark Leung
You should be able to glue something together with
select * from sys.procedures,
create cursor
and
sp_helptext
Happy proceduring
Ethan Hunt
When I highlight multiple functions in the summary list control and select "Script Function as > Create to > File..." the file that is created has a comment preceding each object's definition like "/****** Object: UserDefinedFunction [dbo].[ufnGetAccountingEndDate] Script Date: 11/08/2005 15:00:19 ******/" As a workaround, it should be straight-forward to tease this file apart using Awk, Perl or some other scripting language.
Larry Buerk