是否可以同时触发多个数据库中的一组程序? [英] any way to fire set of procedures in multiple databases at once ?

查看:83
本文介绍了是否可以同时触发多个数据库中的一组程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用sql server 2012.



我有多个数据库系统我的application.so每次当我完成我的开发方面时,我需要通过每次更改数据库手动触发每个数据库上的所有已创建的程序。



有什么方法我可以立即触发我的数据库chnages acrosss所有我需要的数据库?

解决方案

你可以创建一个脚本文件,你可以写你所有的SQL查询。使用链接服务器,您可以从不同数据库的difirent服务器中选择。

创建批处理文件并在批处理文件中调用脚本文件。单击批处理文件以执行sql srcipt文件。 br />


这里是解释如何为sql脚本创建批处理文件的链接。



http://stackoverflow.com/questions/3794897/need-help-to-write-bat-file-that-execute-sql-scripts-in-sql-server-2008-and-ano [ ^ ]



http://stackoverflow.com/questions/3794897/need- help-to-write-bat-file-that-execute-sql-scripts-in-sql-server-2008-and-ano [ ^ ]



想要创建批处理文件来执行SQL脚本 [ ^ ]



您还可以从作业运行批处理文件。

Hi ,

I am using sql server 2012.

I have multiple database system for my application.so each time when i done with my development side , i need to fire all my chnaged , created procedures on each databases manually by changing database each time.

is there any way by which at once i can fire my database chnages acrosss all my required databases ?

解决方案

You can Create a Script file where you can write all your sql query.Using Linked server you can select from difirent server for different database.
Create a Batch File and call the script file in Batch file .Just clicking on the batch file to execute the sql srcipt file.

here is the link which explains how to create batch file for sql script.

http://stackoverflow.com/questions/3794897/need-help-to-write-bat-file-that-execute-sql-scripts-in-sql-server-2008-and-ano[^]

http://stackoverflow.com/questions/3794897/need-help-to-write-bat-file-that-execute-sql-scripts-in-sql-server-2008-and-ano[^]

Want to create a batch file to execute SQL script[^]

You can also run the batch file from jobs.


这篇关于是否可以同时触发多个数据库中的一组程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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