开发者

SQL Server: Copy Stored Procedures [duplicate]

This ques开发者_Go百科tion already has answers here: SQL Server - copy stored procedures from one db to another (11 answers) Closed 9 years ago.

Is there an easy way to copy all stored procedures from one database to another? I have SQL Management Studio installed.


In SQL 2005 and 2008 management: Right click on the database, choose tasks -> generate scripts. You should be able to follow the directions in the wizard from there.

In Sql 2000 you can actually just select the procedures you want to copy, ctrl+c to copy them, then paste them into a new query window for the other DB and run it.


You can script objects out with SQL Management Studio by right clicking the database name and clicking script objects(or something like that I'm not on my Windows machine right now to check). You can select to do just the stored procs and select to have all the output go to one file instead of 1 file per an object. Once you have them in one file you can run that file against your database.

Also look into Red Gate Software's tool called SQL Compare http://www.red-gate.com/products/SQL_Compare/index.htm It's not free but does have a free trial.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜