Script all stored procedures in Management Studio

2019-01-23 00:31发布

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?

5条回答
We Are One
2楼-- · 2019-01-23 01:04

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.

查看更多
手持菜刀,她持情操
3楼-- · 2019-01-23 01:04

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

查看更多
放我归山
4楼-- · 2019-01-23 01:06
  1. Go to Microsoft SQL Server Management Studio
  2. Select the database
  3. Right click on selected database
  4. Select 'Tasks'
  5. Select 'Generate Scripts'
  6. Select 'Next'
  7. Select / tick 'Select specific database objects'
  8. Tick 'Stored Procedures'
  9. Select 'Next'
  10. Select the option where do you want to save the file
查看更多
Animai°情兽
5楼-- · 2019-01-23 01:23

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

Presto!

查看更多
倾城 Initia
6楼-- · 2019-01-23 01:25

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.

查看更多
登录 后发表回答