如何批量运行存储过程
我正在使用 Aqua Data Studio 和 sybase。 假设我在数据库 1 中创建了 20 个不同的存储过程,现在我需要将所有存储过程迁移到数据库 2。我可以以批处理模式执行此操作吗?
目前,我必须将每个存储过程的内容复制到 Aqua Studio 中的查询分析器中,然后单击“运行”按钮,我必须执行 20 次。
当然一定有更简单的方法吗?
I am using Aqua Data Studio and sybase.
Say I have 20 different stored procedures created in database 1, now I need to migrate all the stored procedures to database 2. Can I do this in batch mode?
Currently, I have to copy the content of each store procedure into query analyser in Aqua Studio and hit "run" button, and I have to do it 20 times.
Surely there must be an easier way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道产品“Aqua Data Studio”,但我要做的是以下操作:
使用 sp_helptext 获取所有过程的 sql,然后将它们复制到一个 SQL 文件中,您可以针对数据库 2 运行该文件。
不确定是否这实际上就是您的第三方产品正在做的事情。无论如何,据我所知,只要您没有保存用于在数据库 1 中创建的原始 sql 文件,就没有其他方法;-)
希望有所帮助
I don't know the product "Aqua Data Studio" but what i would do is the following:
use sp_helptext to get the sql for all your procs and then copy them in a SQL file which you can run against database 2.
not sure if that is actually what your third party product is doing. anyway, as far as i know there is no other way as long as you don't have saved the original sql files for the creation in database 1 ;-)
hope that helps