How to execute same SP in 2 different connection
How to execut开发者_如何学Pythone same SP in 2 different connection.
Ex: ALTER PROCEDURE test ... ....
I want to execute this SP in db called "database1" in 192.168.1.100 and same in 192.168.1.102.
I want this to be done using script not using the change connection window
You can use SQLCMD to run a .sql file against multiple server connections.
sqlcmd -S <ComputerName>\<InstanceName> -i <MyScript.sql> -d <database_name> -T
You can do that in SSMS Tools Pack using one of its features called "Run one script on multiple databases".
Editing this to add that this is a tiny and free add-in to SQL Server, that you would find extremely useful.
精彩评论