﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Joey Doherty / Article Discussions / Article Discussions by Author  / Deploying Scripts To Multiple Instances / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 12:47:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Boy that was a "Dah" on my part....somehow I did that the first time  and it came up empty...obviously a "user error'!. I found it fine now..thanks alot for your assistance!</description><pubDate>Tue, 24 Feb 2009 09:17:52 GMT</pubDate><dc:creator>Joe Yanul</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Ok, just copy "Managing many SQL Servers?" (without the quotes) and paste it into the Search window (above and to the right) and clcik Go and then on the results screen click on articles.Rudy</description><pubDate>Tue, 24 Feb 2009 08:52:16 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Hi again Rudy..I'am new on using this forum...is there an easy way to get to your article?....I've serached and cannot seem to locate it...thanks for your assistance!</description><pubDate>Tue, 24 Feb 2009 08:48:20 GMT</pubDate><dc:creator>Joe Yanul</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Hello Joe,Have a look at an article I created here called "Managing many SQL Servers?" and see if this works for you. Code is also provided.Thanks,Rudy</description><pubDate>Tue, 24 Feb 2009 08:35:25 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Hi. This is really a great post and is something I would like to implement.Rudy, is thewre anyway you can send me your updated code that you mentioned..it sounds like enhancements I could use..thanks</description><pubDate>Tue, 24 Feb 2009 07:40:20 GMT</pubDate><dc:creator>Joe Yanul</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Joe - Good basic script for dynamic Linked Servers...an auxilary post I have put up is remote RECONFIGURE capability as:[linked-server].master.dbo.RECONFIGURE does not work.Any ideas appreciated!thnx Jay</description><pubDate>Mon, 15 Dec 2008 12:52:28 GMT</pubDate><dc:creator>jmisc</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>this was a great starting point for me to create my solution. I used the script as a model and added some needed customizations.</description><pubDate>Fri, 10 Oct 2008 14:04:05 GMT</pubDate><dc:creator>dustin.jones</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Hello Joe and everyone else,I would like to thanks you for the article. Read this when it first came out and have since modified it for my need. Here are the modifications I made.- Create table with contains Servers Name, Type (Prod or Development), Version number (2000 /2005) and Owner of the system (Finance, account, etc). This will all me to specify which systems I want to do remote execution on. So if I only want to run code against the development SQL 2000 servers only I can. Also, as new server come to our network I would just add it's info into this table and it done.- Enhanced the error handling for server(s) that already have a link connection- Made my server trusted by all the other servers so that passwords and ids are not needed for connection. My main server is completely locked down on all levels, don't need someone to connect and then have full access to the other servers.- Made a generic version of the code so that I execute anything I need on the remote server. This works for my SSRS report page. I use this code to produce several reports which include:  1) Job failures report on all servers, production only and / or development onhly  2) SQL Error log analysis report  I can send you my updated code if you like.Thanks,Rudy</description><pubDate>Thu, 07 Feb 2008 09:05:27 GMT</pubDate><dc:creator>Rudy Panigas</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P&gt;Good Post! &lt;/P&gt;&lt;P&gt;How can I pass the linkserver in the OPENQUERY.  I try the following query, it doesn't like @LinkSrvName,  if I change @LinkSrvName to actual servername (ServerB).  It works fine.&lt;/P&gt;&lt;P&gt;  SELECT * FROM OPENQUERY (@LinkSrvName,'SELECT @@servername, SERVERPROPERTY(''productversion'') ,  SERVERPROPERTY (''productlevel'') , SERVERPROPERTY (''edition'')')&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;CS&lt;/P&gt;</description><pubDate>Fri, 25 May 2007 08:17:00 GMT</pubDate><dc:creator>tongbee</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P&gt;This is true, I did not think that this solution was portrayed as "the only one". just that the performance concern is pretty big, and osql option is just as easy so I thought you would have wanted to mention that.&lt;/P&gt;</description><pubDate>Wed, 27 Sep 2006 12:52:00 GMT</pubDate><dc:creator>BitWise MnM</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Well he did preface the article by saying that people might have other software to do this sort of thing easily. For those situations where DBA's don't have that, this technique is a nice and viable alternative. In that sense, this article is very good in demonstrating the alternative.</description><pubDate>Wed, 27 Sep 2006 12:43:00 GMT</pubDate><dc:creator>clee51</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>If you use tools like SQL Farm Combine you can run this script, or any other scripts against any number of servers with zero effort or coding (adding/removing remote servers, etc.), and also get aggregated and/or individual results from all databases and servers. I do think that this technique is pretty cool, but not extremely useful.</description><pubDate>Wed, 27 Sep 2006 07:55:00 GMT</pubDate><dc:creator>Omri Bahat-228920</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P&gt;while it may seem like a nice idea to run a multi instance task right from your Query Analyzer, I wouldn't do it. First of all performance is bound to be terrible, second of all, you can not use some of the query hints (like with (nolocks)). I think that a osql batch file would be just as easy to use, and certainly more versitile, not to mention a VB script (which can even be a DTS job)... &lt;/P&gt;</description><pubDate>Wed, 27 Sep 2006 07:40:00 GMT</pubDate><dc:creator>BitWise MnM</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;I got the idea. Thanks. I will try this let you guys know. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description><pubDate>Wed, 27 Sep 2006 02:44:00 GMT</pubDate><dc:creator>Ravi Prashanth Lobo-275382</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P&gt;For deploying sp's (which are located in a script called C:\mySP.sql) you can use:&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;SET @mySQL = 'CALL isql -S' + @InstanceName + ' -E -i"C:\mySP.sql" &amp;lt; and the rest of your isql options&amp;gt;'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;EXEC sp_executesql @mySQL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Ofcourse this only works if the file is located on your machine hosting SQL Server. If you're working remotely (as most people are) you can put the "CALL isql"-commands in a temp-table, select all rows from this table and put them in a batch-file:&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;CREATE TABLE #tmp (cmd VARCHAR(4000))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;-- Do the following for all your instancesBEGIN   INSERT #tmp (cmd) VALUES ('CALL isql -S' + @InstanceName + ' -E -i"C:\mySP.sql" &amp;lt; and the rest of your isql options&amp;gt;')END&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;-- when you're finishedSELECT cmd FROM #tmp&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #dddddd" face="Courier New"&gt;-- Paste the result in a *.bat file and execute it&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Grtz, Lex&lt;/P&gt;</description><pubDate>Wed, 27 Sep 2006 02:36:00 GMT</pubDate><dc:creator>AlexP-220494</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P&gt;Your error handling is screwed.&lt;/P&gt;&lt;P&gt;The moment you run any code after the line the has an error @@error is reset, you can test this fact with the following:&lt;/P&gt;&lt;PRE&gt;select 1/0 as bobif @@error&amp;lt;&amp;gt;0 begin print @@errorend&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Your error checking should be as follows:&lt;/P&gt;&lt;PRE&gt;SET @Error = @@ErrorIF @Error &amp;lt;&amp;gt; 0BEGIN GOTO spERROREND&lt;/PRE&gt;&lt;PRE&gt; &lt;/PRE&gt;&lt;PRE&gt; &lt;/PRE&gt;</description><pubDate>Wed, 27 Sep 2006 01:41:00 GMT</pubDate><dc:creator>sgtwilko</dc:creator></item><item><title>RE: Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;Good article. Got some new ideas. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;Will this approach work for complex sql? Suppose I want to create a SP on multiple servers?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=postbody1&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;How about a batch file and isql?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description><pubDate>Wed, 27 Sep 2006 01:23:00 GMT</pubDate><dc:creator>Ravi Prashanth Lobo-275382</dc:creator></item><item><title>Deploying Scripts To Multiple Instances</title><link>http://www.sqlservercentral.com/Forums/Topic311197-322-1.aspx</link><description>Comments posted here are about the content posted at &lt;A HREF="temp"&gt;temp&lt;/A&gt;</description><pubDate>Tue, 26 Sep 2006 07:37:00 GMT</pubDate><dc:creator>Joe Doherty-260822</dc:creator></item></channel></rss>