将存储过程从一个数据库移动到另一个 [英] moving stored procedures from one database to another

查看:150
本文介绍了将存储过程从一个数据库移动到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何人有一个脚本将存储过程从当前数据库

以编程方式复制到另一个数据库

创建程序移动

Decalre @databasename nvarchar(255) - 我要移动存储的数据库

程序



谢谢

解决方案

您可以通过以下简单步骤完成



1.在Management Studio中访问服务器

2。选择数据库,右键单击它转到任务。

3.选择任务

下的生成脚本选项4.一旦启动,选择所需的存储过程复制

并创建它们的文件,然后将脚本从该文件运行到要创建它们的DB。


按照步骤



1.转到商店程序并右键单击并创建并删除脚本

2.从其他数据库打开查询窗口。

3.执行th e存储过程脚本


查看此链接..这可能对您有所帮助..



http://stackoverflow.com/questions/10703424/sql-server-copy-stored-程序 - 从一个数据库到另一个数据库 [ ^ ]



复制..



https://social.msdn.microsoft.com/Forums/sqlserver/en-US/646dedb7-3507-4e21-9d24-834bc43e023f/ copy-all-sps-from-one-database-to-another-database-using-a-script?forum = transactsql [ ^ ]

Does any one have a script that copies stored procedures from current database
to another database programmatically
create procedure move
Decalre @databasename nvarchar(255) --the database which i want to move stored
procedures to

thanks

解决方案

you can do it in below simple steps

1. Go the server in Management Studio
2. Select the database, right click on it Go to Task.
3. Select generate scripts option under Task
4. and once its started select the desired stored procedures you want to copy
and create a file of them and then run script from that file to the DB where you want to create them.


Follow the Steps

1. Go to Store Procedure and right click and create and drop script
2. Open the Query window from other database.
3. Execute the Store procedure script


See this link.. this may help you..

http://stackoverflow.com/questions/10703424/sql-server-copy-stored-procedures-from-one-db-to-another[^]

Copy..

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/646dedb7-3507-4e21-9d24-834bc43e023f/copy-all-sps-from-one-database-to-another-database-using-a-script?forum=transactsql[^]


这篇关于将存储过程从一个数据库移动到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆