如何复制存储过程 [英] How can I copy a stored procedure
问题描述
亲爱的朋友
我不知道如何使用VB.net复制存储过程
I do not know how can I copy a stored procedure, using VB.net
我知道如何创建它.但是问题是如何将它从数据库复制到另一个数据库.
I know how can I create it. but the question is how can I copy it from a DB to another.
谢谢
推荐答案
此演练对您特别有用:
This walkthrough should be particularly useful to you:
http://www.sqlteam.com/article/scripting-database-objects -using-smo-updated
这是一些相关的MSDN文档:
And this is some related MSDN documentation:
http://msdn.microsoft.com/en-us/library /microsoft.sqlserver.management.smo.aspx
我不确定,但是这些类可能对您有用,因此您可能需要研究一下它们:
And I''m not sure, but these classes may be of use to you, so you may want to look into them:
Microsoft.SqlServer.Management.Smo.Scripter
Microsoft.SqlServer.Management.Smo.StoredProcedure
在开始任何操作之前,请确保添加对该程序集的引用:
And before you start anything, make sure to add a reference to this assembly:
Microsoft.SqlServer.Smo
基本思想是,您将从一个数据库中编写脚本,然后将该脚本应用于另一个数据库.当然,这是假设您要以编程方式完成所有这些操作.
The basic idea is that you''ll script it out from one database then apply the script to another database. This is, of course, assuming that you want to do all this programmatically.
这篇关于如何复制存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!