使用 query/proc 运行多个查询
我对 SQL 还很陌生,所以请耐心等待。我有 18 个查询,希望将其作为 1 个查询运行。它们非常长,如果我将它们复制并粘贴到 1 个查询中,则太大而无法保存。
有没有办法调用这 18 个查询并立即运行它们?我知道我可以物理地打开它们并单独运行它们,但我希望有一个更加自动化的过程。
谢谢
I am fairly new to SQL so please bear with me. I have 18 queries that I would like to run as 1 query. They are very long and if I copy and paste them onto 1 query, it is too big to save.
Is there a way to call up these 18 queries and run them at once? I know I could physically open them all and run them individually but I was hoping for a more automated process.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您不需要查询的结果。
在 Microsoft sql 上查找 sql 代理,您可以在其中定义一个包含 18 个步骤的“作业”来运行您的查询。
或者,在所有其他 sql 系统上,您可以查看命令行脚本来执行查询,然后使用 cronjob 自动运行它们。
I assume you don't need the results of the query.
On Microsoft sql Look up the sql Agent, there you can define one "job" with 18 steps running your queries.
Alternatively and On all other sql systems you can look at a commandline script to execute the query and then use a cronjob to run them automatically.