views:

1789

answers:

5

In Enterprise Manager you could script all SPs in a database through the right click menu, is there a way to do it in Management Studio?

+3  A: 

You can right click on the database and to go Tasks -> Generate Scripts...

This will allow you to script all or selected objects (schema, stored procedures, tables, users and views) with specific options.

Brian Kim
There tend to be about 20 steps for me to generate these scripts (which I'm doing for version control purposes). Is there an easier way--perhaps a way to have the wizard remember all the past settings?
Kimball Robinson
A: 

Right click the database, choose Tasks, choose Generate Scripts.., click Next, Next again, choose Stored procedures, Next, Select All, Finish.

Presto!

sebastiaan
A: 

If you right click on the database name, the bottom option is "Generate Scripts" which will then launch a wizard to generate scripts for the whole DB or specific objects inside.

Nick DeVore
+2  A: 

Sure. All you need to do is to is click on the Stored Procedure in the Object Explorer and then highlight all the stored procedures in the Summary pane. Then simply right click and choose the scripting option that you prefer.

Good luck

wcm
A: 

Thanks, WCM. How we long for the days of being able to DROP and then CREATE in one script. Who designs this new sh...?

CraigWilliamson