如何批量运行存储过程

发布于 2025-01-06 04:08:57 字数 199 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栩栩如生 2025-01-13 04:08:57

我不知道产品“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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文