Updating a stored procedure on three different servers

I need to update the SQL SERVER stored procedure on three different servers. I do not like to do this manually. What are my options?

+4
source share
6 answers

You can use the SQLCMD utility to connect to three different servers / databases and run the script stored procedure. The script control might look something like this:

:connect server1 use DatabaseName GO :r StoredProcedure.sql GO :connect server2 use DatabaseName GO :r StoredProcedure.sql GO :connect server3 use DatabaseName GO :r StoredProcedure.sql GO 

SQL Compare is a great tool, especially for large or complex updates. However, you will have to pay for it. Using a utility like SQLCMD is not so elegant, but fast and free.

+3
source

Use a tool, such as Red-Gate SQL Compare, to create a script, and then use their Multi-Script tool to execute it on multiple servers at a time.

www.red-gate.com

+2
source

You can use a SQL Server synchronization tool such as Red Gate SQL Compare . Or you can write a small script / application to connect to each server and execute the update statement using OSQL .

+1
source

You can configure some replication between the servers ... there is 1 main server on which you install the update, and then send this update to another server using the publication on other servers. That would be an easy way to do this.

0
source

Abandon Migrator.NET , in conjunction with a builder like Hudson , which starts when you register, it should do the trick. In addition, you get versions and rollbacks with it.

0
source

Using the Central Management Servers feature in SQL Server 2008, you can add these three servers to one group, and then run one script change procedure for these three servers.

0
source

Source: https://habr.com/ru/post/1302045/


All Articles