The other way to script objects of your database in SQL Server 2005/2008 is to use the Microsoft SQL Server Database Publishing Wizard 1.1.
However if you need to do the same task programmatically using T-SQL, then here's the T-SQL that will help you do so:
This query will list down all the stored procedures and their definitions of your database. In order to save the results of this SELECT statement to a text file, check this post of mine
Save SELECT query output to a text file
Did you like this post?
|subscribe via rss||subscribe via e-mail|
|print this post||follow me on twitter|