﻿<?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 Andy Warren / Article Discussions / Article Discussions by Author  / Copying DTS Packages To a Different Server / 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 08:14:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Andy, I just want to start off by really thanking you for this script!  I modified it to work in a DTS package and made a few other modifications.  Maybe someone else would like to have the ability to save it inside a DTS package.  This package will be deployed to update a PD server after updates on a DP server are complete.Modifications:- Converted to VB ActiveX Script for use inside a DTS Package on SQL 2000- Added the reference of global variables for the server names- Added check to copy only new versions of a package- Check to make sure the package that migrates all the DTS packages is not copied (this can be expanded to include other ones as well.)Thanks again!~Taylor'**********************************************************************'  Visual Basic ActiveX Script'************************************************************************Function Main()	MoveDTSPackages DTSGlobalVariables("SourceServer").Value, DTSGlobalVariables("DestinationServer").Value	Main = DTSTaskExecResult_SuccessEnd FunctionSub MoveDTSPackages(ByVal SourceServer, ByVal DestinationServer)		'3/16/02 Andy Warren	'Code to copy DTS packages using ADO to move the data, a binary copy	'2/27/07 Taylor Geisse - Modified to run in VB ActiveX Script for use in DTS	' Constants - http://www.connectionstrings.com/adoenumerations.asp	Const adUseClient = 3	Dim cnSource 	Set cnSource = CreateObject("ADODB.Connection")	Dim cnDestination	Set cnDestination = CreateObject("ADODB.Connection")	Dim rsSource	Set rsSource = CreateObject("ADODB.Recordset")	Dim rsDest	Set rsDest = CreateObject("ADODB.Recordset")	Dim sqlSourceCmdText	Dim sqlDestCmdText	If SourceServer = "" Or DestinationServer = "" Then	    MsgBox "Must provide both source and destination server names."	    Exit Sub	ElseIf UCase(SourceServer) = UCase(DestinationServer) Then	    MsgBox "Source and destination server names cannot be the same."	    Exit Sub	End If	'establish a trusted connection to source server	cnSource.CursorLocation = adUseClient	cnSource.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MSDB;Data Source=" &amp; SourceServer)	'another connection for destination server	cnDestination.CursorLocation = adUseClient	cnDestination.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MSDB;Data Source=" &amp; DestinationServer)	'Build a list of packages that exist on the source server	sqlSourceCmdText = "select * from msdb..sysdtspackages order by createdate"	rsSource.Open sqlSourceCmdText, cnSource	'iterate through all sql packages on the source server	With rsSource	    Do Until .EOF		'Copy only package versions that do not exist on the destination server.		'Also check to make sure that we do not copy this (and other?) packages.		sqlDestCmdText = "select COUNT(*) AS [RowCount] from msdb..sysdtspackages where [id] = '" &amp; .Fields("ID") &amp; "' and [versionid] = '" &amp; .Fields("VersionID") &amp; "'"		rsDest.Open sqlDestCmdText, cnDestination				' If a package (id/version) already exists, do not add the source package!		If rsDest.Fields("RowCount").Value = 0  And .Fields("Name")  &lt;&gt; "Migration" Then			Call AddDTSPackage(cnDestination, .Fields("Name"), .Fields("ID"), .Fields("VersionID"), .Fields("Description"), .Fields("CategoryID"), .Fields("Owner"), .Fields("PackageData"), .Fields("PackageType"))		End If	    			rsDest.Close		.MoveNext	    Loop	End With	'clean up	rsSource.Close	cnSource.Close	cnDestination.Close	Exit SubEnd SubSub AddDTSPackage(ByVal cn, ByVal PackageName, ByVal ID, ByVal VersionID, ByVal Description, ByVal CategoryID, ByVal Owner, ByVal PackageData, ByVal PackageType)	' Constants - http://www.w3schools.com/ado/met_comm_createparameter.asp	Const adCmdStoredProc = 4	Const adInteger = 3	Const adVarWChar = 202	Const adGUID = 72	Const adVarBinary = 204	Const adParamReturnValue = 4	Const adParamInput = 1	Dim cmd	Set cmd = CreateObject("ADODB.Command")	Dim params	' Set command properties	With cmd	    Set .ActiveConnection = cn	    .CommandText = "sp_add_dtspackage"	    .CommandType = adCmdStoredProc	    Set params = .Parameters	End With	' Define stored procedure params and append to command.	params.Append(cmd.CreateParameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0))	params.Append(cmd.CreateParameter("@name", adVarWChar, adParamInput, 128))	params.Append(cmd.CreateParameter("@id", adGUID, adParamInput, 0))	params.Append(cmd.CreateParameter("@versionid", adGUID, adParamInput, 0))	params.Append(cmd.CreateParameter("@description", adVarWChar, adParamInput, 255))	params.Append(cmd.CreateParameter("@categoryid", adGUID, adParamInput, 0))	params.Append(cmd.CreateParameter("@owner", adVarWChar, adParamInput, 128))	params.Append(cmd.CreateParameter("@packagedata", adVarBinary, adParamInput, 2147483647))	params.Append(cmd.CreateParameter("@packagetype", adInteger, adParamInput, 0))	' Specify input parameter values	params("@name") = PackageName	params("@id") = ID	params("@versionid") = VersionID	params("@description") = Description	params("@categoryid") = CategoryID	params("@owner") = Owner	params("@packagedata") = PackageData	params("@packagetype") = PackageType	' Execute the command	cmd.Execute , , adExecuteNoRecordsEnd Sub</description><pubDate>Tue, 27 Feb 2007 11:43:00 GMT</pubDate><dc:creator>Taylor Geisse</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Hi AllFurther to this topic - we have a T-SQL script from the net that will take a DTS package from a structured storage file, load it into SQL Server, and modify the connection names etc. in the process.BUT..... when we use this script to load a package, then open the loaded package up in Enterprise Manager on the new server, the layout has been wrecked. All the tasks, workflows etc. are still in place and accurate; but the various tasks have been relocated on the screen and spaced so far apart that it takes a zoom out (to about 20%) to see them all.Does anybody know of a way to load/modify/save a DTS package this way without this automatic re-layout happening?Dave.</description><pubDate>Fri, 20 Oct 2006 07:35:00 GMT</pubDate><dc:creator>David F. Straker</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Or you could use a tool that I have found fantastic.  SQL backup2000 provides a nice GUI interface and is very handy for copying large numbers of packages.  I think you can find it at SQLDTS.com and the author is Darren Green.  A great tool where ou specify the source and target, all packages on the source server are identified and you can select one or hundreds to migrate to the specified destination.  Supports passwords etc.  Give it a go its been a very usefull tool.</description><pubDate>Mon, 03 Jul 2006 04:21:00 GMT</pubDate><dc:creator>dharper3</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Ok it done.I moved packages to a file which i saved into c drive. Now i want to paste it back to SQL server. How i will do ythrough DTSrun.exe ? or some other way?</description><pubDate>Tue, 23 May 2006 20:55:00 GMT</pubDate><dc:creator>sandipanghosh</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;The easiest way according to me is to transfer them directly like:&lt;/P&gt;&lt;P&gt;-- All packagesinsert into msdb.dbo.sysdtspackesselect *from remote_server.msdb.dbo.sysdtspackageswhere (blah.. blah)                                                  OR                                           -- Latest versions of packagesinsert into msdb.dbo.sysdtspackesselect a.*from remote_server.msdb.dbo.sysdtspackages a   join (   select [id], versionid, max(createdate)   from remote_server.msdb.dbo.sysdtspackages   group by [id], versionid       ) b on a.[id] = b.[id] and              a.versionid = b.versionidwhere (blah.. blah)&lt;/P&gt;&lt;P&gt;Are there any disadvantages doing this kind of transfer?&lt;/P&gt;&lt;P&gt;Venu&lt;/P&gt;</description><pubDate>Fri, 12 May 2006 15:52:00 GMT</pubDate><dc:creator>Venu Dukka</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;Talk about timing......&lt;/P&gt;&lt;P&gt;I have just created a server health check process that runs every morning, this health check is stored in a scheduled DTS package and it needed to be placed on all our SQL Server (over 20 box), this code is just what the doctor ordered.  &lt;/P&gt;&lt;P&gt;&lt;img src='images/emotions/w00t.gif' height='20' width='20' border='0' title='w00t' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Wed, 10 May 2006 03:40:00 GMT</pubDate><dc:creator>Mark Taylor-212571</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>DTSBackup2000 is the one for me - as it also allows you to save away copies of the jobs in its own format that preserves layout etc (not on any server) which you can then easily restore when some pillock deletes a package ...</description><pubDate>Tue, 09 May 2006 13:19:00 GMT</pubDate><dc:creator>James Horsley</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;I used dynamic property in my DTS Package.  The connection server that used to get the data was in the dynamic property and passed thru as a parameter in the job "exec dtsrun".&lt;/P&gt;&lt;P&gt;So when the DBA moved from one server to another server, all they had to do was to open the DTS Package and saved as in the other server.  They did not need to change another connection in the DTS package itself.  I was the only SQL Server programmer in that company that knew how to do this.  It saved the DBA a lot of time, however it did not seem they appreciate what I did.  &lt;img src='images/emotions/sad.gif' height='20' width='20' border='0' title='Sad' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;They did not even tell any other SQL developers so now when they move the dts packages (a couple hundred) and had to open each one to change the connection servers.   Good for them !  This is their job security.  &lt;/P&gt;</description><pubDate>Mon, 08 May 2006 10:14:00 GMT</pubDate><dc:creator>Loner</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;what about this easy tool which called dtsbackup2000&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sqldts.com/default.aspx?272"&gt;http://www.sqldts.com/default.aspx?272&lt;/A&gt;&lt;/P&gt;</description><pubDate>Mon, 08 May 2006 08:30:00 GMT</pubDate><dc:creator>osama-240238</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>At my job, I develop DTS packages on a dev server, they then need to be copied to our clients test environment. The client will, after succesful testing, do a save manually from their testing to their prod. But this means I regularly have to put 30-ish DTS's from our environment to theirs. Couple of steps :1) In every DTS that you make, use "set dynamic properties" for defining the servers and DBs that you work on through an .ini file in a fixed location (so that the same DTS will work in another environment, not failing on cannot find server). Every DTS starts with this.2) export DTSs from a view on sysDTSpackages that takes only the latest version into a tab delimited txt file.3) put the txt file on the FTP.I do 2 &amp; 3 through an export DTS.4)Import txt file from FTP into temp table.5)backup the DTSs that already exist in a backup table.6)delete existing DTSs that are also in temp table from server7) copy from temp table to sysdtspackages.4 through 7 are combined in an import DTSThis process maintains text annotations and lay-out.That's working well for me at this point...Grtz, Pete</description><pubDate>Fri, 05 May 2006 23:22:00 GMT</pubDate><dc:creator>Peter De Ceulaer</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;Andy,&lt;/P&gt;&lt;P&gt;This is cool. Good article.&lt;/P&gt;&lt;P&gt;Did someone try to restore MSDB as another database (I did that) , rename the syspackages table (I did not do that yet) and get data this way by DTS?&lt;/P&gt;&lt;P&gt;I also will be  interested if someone will make the same tracing with Save As VBscript File and code a loop that will create one or many files with code for all packages in VBscript. Then it will be easier to do Replace on the server name, share names, IPs and other changable things.&lt;/P&gt;&lt;P&gt;Yelena&lt;/P&gt;</description><pubDate>Fri, 05 May 2006 15:46:00 GMT</pubDate><dc:creator>Yelena Varshal</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;Thanks for showing how one could do this programatically.&lt;/P&gt;&lt;P&gt;An alternative approach that I find useful is here: &lt;A href="http://www.sqldts.com/default.aspx?204"&gt;http://www.sqldts.com/default.aspx?204&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;dj&lt;/P&gt;</description><pubDate>Fri, 05 May 2006 11:36:00 GMT</pubDate><dc:creator>Dexter Jones</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I just normally restore the MSDB from the source to the destination server whenever I have to migrate to a new server. But yes, it also copies all the other stuff including jobs and maintenance plans which you may not need on the destination server.</description><pubDate>Fri, 05 May 2006 11:03:00 GMT</pubDate><dc:creator>Kedar Potdar</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;SPAN id=Showtread1_ThreadRepeater__ctl1_lblFullMessage&gt; &lt;P&gt;I often copy packages from our QA to Production servers and have been looking to use a way to do it that is dependable. Normaly I just save to a flat file and move the file over to prod server, re-open it, then save it to SQL Server. I had used the freeware tool "DTSBackup2000" numerous times in the past until on a couple of complex packages the layout and some info within the package "changed". Since then I have been leery about using it and have stuck with the file save method.&lt;/P&gt;&lt;P&gt;Have you had any experience with this tool? Are there any other tools available that perform this same function?&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/SPAN&gt;</description><pubDate>Fri, 05 May 2006 07:50:00 GMT</pubDate><dc:creator>chubbsm</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;I used the steps as set out by &lt;A href="http://www.sqldts.com"&gt;www.sqldts.com&lt;/A&gt; and they worked great.&lt;/P&gt;&lt;P&gt;Just wondering, is there any way of amending the connections within the dts packages without having to modifiy each DTS package seperatly?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description><pubDate>Fri, 05 May 2006 07:10:00 GMT</pubDate><dc:creator>sqlrumble</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;P&gt;Here is another approach that we have used internally.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sqlservercentral.com/columnists/bszabo/adtsdatastore.asp"&gt;http://www.sqlservercentral.com/columnists/bszabo/adtsdatastore.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sqlservercentral.com/columnists/bszabo/restoreadtspackagefromadtsstore.asp"&gt;http://www.sqlservercentral.com/columnists/bszabo/restoreadtspackagefromadtsstore.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Fri, 05 May 2006 06:38:00 GMT</pubDate><dc:creator>cliffb</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I've developed a few dts packages for our customers, and the delivery mechanism I have used for the dts package is: while in the designer, goto the "Save As..." menu, change the "location" from "SQL Server" to "Structured Storage file".  A filename is suggested, you specify the location for that file to be generated, then hit "OK".  Then you have a *.dts file that you can email, ftp, zip up (if large), etc.  You put that file onto the destination server.To get it into the destination SQL Server, Right-click on the "Data Transformation Services" folder in Enterprise Manager and select "Open Package" then find and select the saved .dts file.  It will open it up into the Designer.  Before you start making any changes goto the Save As menu once more, this time choose "SQL Server" for its location and save it to the local SQL Server.  Of course after all this, like all other transfer methods, you will have to change all of the content of the DTS that has specific references to the local SQL Server that may be different.</description><pubDate>Fri, 05 May 2006 05:34:00 GMT</pubDate><dc:creator>John Bowman-237558</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>&lt;DL&gt;&lt;DT&gt;Hello,&lt;/DT&gt;&lt;DT&gt;I personally prefer the following method:&lt;/DT&gt;&lt;DT&gt;Import Data-&amp;gt;Select source server and msdb -&amp;gt; select destination server and msdb -&amp;gt; Use a query &lt;/DT&gt;&lt;DT&gt;to specify the data to transfer -&amp;gt; SELECT * FROM sysdtspackages [where xyz] -&amp;gt; Type sysdtspackages as Destination object -&amp;gt; Run&lt;/DT&gt;&lt;DT&gt; &lt;/DT&gt;&lt;DT&gt;The only cosmetic issue will be that the creation of the sysdtspackages table on the destination &lt;/DT&gt;&lt;DT&gt;server will fail (which makes sense as it already exists). When you save to DTS, you can remove &lt;/DT&gt;&lt;DT&gt;this extra step.&lt;/DT&gt;&lt;DT&gt; &lt;/DT&gt;&lt;DT&gt;An additional method is to LoadFromSQLServer-&amp;gt;SaveToStorageFile then &lt;/DT&gt;&lt;DT&gt;LoadFromStorageFile-&amp;gt;SaveToSQLServer. This can be fully automated while preserving all versions &lt;/DT&gt;&lt;DT&gt;of a DTS package. &lt;/DT&gt;&lt;DT&gt;This method can be used when the SQL Servers have no direct connection. (Note that several &lt;/DT&gt;&lt;DT&gt;versions of a package and even different packages can be stored in one structured storage file. &lt;/DT&gt;&lt;DT&gt;Use "GetSavedPackageInfos" to find out how to iterate over all packages and versions stored in one &lt;/DT&gt;&lt;DT&gt;storage file. But make sure you save the various versions of a package in the correct order as &lt;/DT&gt;&lt;DT&gt;the create date and save date will not be preserved.&lt;/DT&gt;&lt;DT&gt; &lt;/DT&gt;&lt;DT&gt;Cheers,Chris&lt;/DT&gt;&lt;/DL&gt;</description><pubDate>Fri, 05 May 2006 01:58:00 GMT</pubDate><dc:creator>Christian Buettner-167247</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I knocked this script up to copy either all or a set of listed dts packages from one server to another.  If it already exists on the destination server it is deleted and replaced otherwise it is simply created.  My convention for portability is to have a global variable set to the server on which the package is running. This script will also update the global variable as it is saved on the destination server.  If the variable name can't be found it will simply continue.Save the script contents to a file called something like copydts.vbsThen from the command prompt run it usingcscript copydts.vbs /svr_src SRCSERVER /svr_dest DESTSERVERfor integrated security or specify the sql security username and password with the parameters in the script.Hope this helps someone.Option Explicit'==============================================================================='- Copy listed or all DTS packages from one SQL Server to another''============================================================================================Dim     SQL_SRC_SERVERNAME, _        SQL_SRC_USERNAME, _        SQL_SRC_PASSWORD, _				SQL_DEST_SERVERNAME, _        SQL_DEST_USERNAME, _        SQL_DEST_PASSWORD'Command Line ArgumentsSQL_SRC_SERVERNAME         = GetArgs( "svr_src", "(local)" )SQL_SRC_USERNAME           = GetArgs( "sqlu_src", "NULL" ) ' standard sql security username. NULL if integrated.SQL_SRC_PASSWORD           = GetArgs( "sqlp_src", "NULL" ) ' standard sql security password. NULL if integrated.SQL_DEST_SERVERNAME         = GetArgs( "svr_dest", "(local)" )SQL_DEST_USERNAME           = GetArgs( "sqlu_dest", "NULL" ) ' standard sql security username. NULL if integrated.SQL_DEST_PASSWORD           = GetArgs( "sqlp_dest", "NULL" ) ' standard sql security password. NULL if integrated.' DTS ConstantsConst DTSSQLStgFlag_UseTrustedConnection = 256Const DTSSQLStgFlag_Default = 0WScript.Echo Now &amp; "  Started scripting DTS packages from " &amp; SQL_SRC_SERVERNAME &amp; " to " &amp; SQL_DEST_SERVERNAMEDim dtsApp 						' As New DTS.ApplicationDim dtsPackage 				' As DTS.PackageSQLServerDim dtsPackageDest 		' As DTS.PackageSQLServerDim dtsPackages 			' As DTS.PackageInfosDim dtsInfo 					' As DTS.PackageInfoDim packagesToCopySet packagesToCopy = WScript.CreateObject("Scripting.Dictionary")With packagesToCopy	' .Add "ALL", ""	.Add "IDL - Export", ""	.Add "IDL - Import", ""	.Add "IDL - Staging To Live - ALL", ""	.Add "NETWORK - Update", ""End WithSet dtsApp = CreateObject("DTS.Application")If SQL_SRC_USERNAME = "NULL" Then	Set dtsPackage = dtsApp.GetPackageSQLServer(SQL_SRC_SERVERNAME, "", "", DTSSQLStgFlag_UseTrustedConnection)Else	Set dtsPackage = dtsApp.GetPackageSQLServer(SQL_SRC_SERVERNAME, SQL_SRC_USERNAME, SQL_SRC_PASSWORD, DTSSQLStgFlag_Default)End IfSet dtsPackages = dtsPackage.EnumPackageInfos("", True, "")For Each dtsInfo In dtsPackages	If packagesToCopy.Exists(dtsInfo.Name) Or packagesToCopy.Exists("ALL") Then		WScript.Echo Now &amp; "  Copying " &amp; dtsInfo.Name			Set dtsPackage = CreateObject("DTS.Package")		If SQL_SRC_USERNAME = "NULL" Then			dtsPackage.LoadFromSQLServer SQL_SRC_SERVERNAME, "", "", DTSSQLStgFlag_UseTrustedConnection, "", "", "", dtsInfo.Name, Nothing		Else			dtsPackage.LoadFromSQLServer SQL_SRC_SERVERNAME, SQL_SRC_USERNAME, SQL_SRC_PASSWORD, DTSSQLStgFlag_Default, "", "", "", dtsInfo.Name, Nothing		End If		On Error Resume Next		dtsPackage.GlobalVariables("ServerName") = SQL_DEST_SERVERNAME			If Err.Number &lt;&gt; 0 Then			Err.Clear		Else			WScript.Echo Now &amp; "  Set global variable IDLServerName to " &amp; SQL_DEST_SERVERNAME		End If		Set dtsPackageDest = CreateObject("DTS.Package")		If SQL_DEST_USERNAME = "NULL" Then			dtsPackageDest.LoadFromSQLServer SQL_DEST_SERVERNAME, "", "", DTSSQLStgFlag_UseTrustedConnection, "", "", "", dtsInfo.Name, Nothing			If Err.Number = 0 Then				WScript.Echo Now &amp; "  Deleting " &amp; dtsInfo.Name &amp; " from " &amp; SQL_DEST_SERVERNAME				dtsPackageDest.RemoveFromSQLServer SQL_DEST_SERVERNAME, "", "", DTSSQLStgFlag_UseTrustedConnection, "", "", dtsInfo.Name			Else				Err.Clear			End If			dtsPackage.SaveToSQLServer SQL_DEST_SERVERNAME, "", "", DTSSQLStgFlag_UseTrustedConnection		Else			dtsPackageDest.LoadFromSQLServer SQL_DEST_SERVERNAME, SQL_DEST_USERNAME, SQL_DEST_PASSWORD, DTSSQLStgFlag_Default, "", "", "", dtsInfo.Name, Nothing			If Err.Number = 0 Then				WScript.Echo Now &amp; "  Deleting " &amp; dtsInfo.Name &amp; " from " &amp; SQL_DEST_SERVERNAME				dtsPackageDest.RemoveFromSQLServer SQL_DEST_SERVERNAME, SQL_DEST_USERNAME, SQL_DEST_PASSWORD, DTSSQLStgFlag_Default, "", "", dtsInfo.Name			Else				Err.Clear			End If			WScript.Echo Now &amp; "  Saving " &amp; dtsInfo.Name &amp; " to " &amp; SQL_DEST_SERVERNAME			dtsPackage.SaveToSQLServer SQL_DEST_SERVERNAME, SQL_DEST_USERNAME, SQL_DEST_PASSWORD, DTSSQLStgFlag_Default		End If	End If	On Error Goto 0	NextWScript.Echo Now &amp; "  Finished scripting DTS packages from " &amp; SQL_SRC_SERVERNAME &amp; " to " &amp; SQL_DEST_SERVERNAME		'-----------------------------------------------------Function GetArgs( sSwitch, sDefaultValue )'-----------------------------------------------------' Checks the command line arguments for a given switch and returns the associated' string, if found. If not found, the defaultValue is returned instead.dim ArgCount, bMatchArgCount = 0bMatch = 0do while ArgCount &lt; WScript.arguments.length    if Eval((WScript.arguments.item(ArgCount)) = ("-" + (sSwitch))) Or Eval((WScript.arguments.item(ArgCount)) = ("/" + (sSwitch))) then        bMatch = 1        Exit do    else        ArgCount = ArgCount + 1    end ifLoopif ( bMatch = 1 ) then        GetArgs = ( WScript.arguments.item(ArgCount + 1) )    else        GetArgs = ( sDefaultValue )end ifEnd Function</description><pubDate>Fri, 05 May 2006 00:52:00 GMT</pubDate><dc:creator>DanKennedy</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Vb6.Steven, copying the table is an option (and not a bad one), sometimes I just like to explore - never know what may turn out to be useful.Andyhttp://www.sqlservercentral.com/columnists/awarren/</description><pubDate>Wed, 29 Oct 2003 18:46:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Personally I find copying the entries in the sysdtspackages table a lot easier, as described at http://www.sqldts.com/?204 </description><pubDate>Fri, 24 Oct 2003 15:07:00 GMT</pubDate><dc:creator>Steven.</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>What platform do you code this in? I'm doing a project for school where I have to copy info from one server to another. Also does there need to be a main routine to pass the values through the function(i.e. Destination Server)? </description><pubDate>Fri, 24 Oct 2003 10:52:00 GMT</pubDate><dc:creator>dpbrown</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>No way to establish a temporary connection over a VPN? You can export to COM files, copy them to the other server that way. Or even export as VB code and run that against the new server. Other than that...you could BCP out the tables involved, BCP back in on the other server.Andyhttp://www.sqlservercentral.com/columnists/awarren/</description><pubDate>Fri, 25 Jul 2003 13:18:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>any suggestions on how to move dts packages from server a to server b where server a and b are totally disconnected from each other? thanks!-nicky </description><pubDate>Fri, 25 Jul 2003 12:18:00 GMT</pubDate><dc:creator>nickyvb</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Yes, it does. Anything that is part of the package gets moved.Andyhttp://www.sqlservercentral.com/columnists/awarren/</description><pubDate>Thu, 25 Jul 2002 16:37:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Does this VB script to move DTS, moves owner id along with the package, because when I use save asuse my userid, and then the developer cannot use it.ThanksAnwar </description><pubDate>Thu, 25 Jul 2002 11:32:00 GMT</pubDate><dc:creator>hussaini</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Having experienced migrating a Data Warehouse from SQL 7.0 to SQL 2000 (a MUST, believe me!), I discovered some very interesting issues with the DTS packages.  You will discover that if you attempt to migrate DTS packages from one SQL2000 server to another, you will NOT be able to edit or delete the DTS packages if the new server has a different name....Seems that rather than embed Local in the msdb entries, it hard codes the server names into the entries...Not pretty. </description><pubDate>Thu, 04 Apr 2002 06:48:00 GMT</pubDate><dc:creator>Lonnie Wimble</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Just remember that UDLs are only usefull in SQL 2000 because in SQL 7.0 they where consumed at design-time not run-time. </description><pubDate>Tue, 02 Apr 2002 07:18:00 GMT</pubDate><dc:creator>darren.green</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Thanks for the feedback. UDL's are handy, not just for DTS packages. Every little bit helps later on.Andy</description><pubDate>Wed, 20 Mar 2002 20:23:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Great article.Let me just add my thoughts on minimizing having to edit your dts packages when you move them to a different server. One way to avoid the need to change all those server connections in dts packages when you move them to another server is to use UDLs.  you can setup UDLs in a centtral repository, say a file server and access them from that location.  just make sure that you check the "always read properties from UDL file" check box. </description><pubDate>Wed, 20 Mar 2002 19:53:00 GMT</pubDate><dc:creator>pochreyes</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Aint that the truth!Andy</description><pubDate>Wed, 20 Mar 2002 16:33:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I sometimes think only in my world too, I never know what to expect in the package I develop in and maintain.  Too many different "styles" to count on any thing working like that.  I'm also glad not to be working in app with 200 or more DTS packages transferring data between data sources! </description><pubDate>Wed, 20 Mar 2002 16:25:00 GMT</pubDate><dc:creator>retreif</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Retreif - I agree. You either have to spend extra time (possibly anyway) when you build it to make it portable or live with the consequences if/when you have to move it. I figure you could at least do the bulk move, then edit the ones you knew you had to fix, then see whats left!Darren - thanks for the link. Should have looked there first! Fun to explore though. Have you considered participating in the beta test mentioned above?Andy</description><pubDate>Wed, 20 Mar 2002 13:50:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>The limitation of the wizard not allowing you to transfer system tables can be overcome by building the package manually.Transferring DTS Packageshttp://www.sqldts.com/main.asp?nav=1,6,204,0 </description><pubDate>Wed, 20 Mar 2002 13:35:00 GMT</pubDate><dc:creator>darren.green</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I guess my point was if you have to go in to review each DTS package to check if pathing whatever is correct then file save as works as well as spending the time to get this working.  I'm not saying this isn't a slick way to automate if you can be sure.  Sorry I didn't express that better the first time. </description><pubDate>Wed, 20 Mar 2002 11:39:00 GMT</pubDate><dc:creator>retreif</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>I haven't had a chance yet to test it, but it is an interesting concept for moving DTS packages that I will have to play with it. Good job."Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)</description><pubDate>Wed, 20 Mar 2002 11:14:00 GMT</pubDate><dc:creator>Antares686</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Depends on how many you're moving doesn't it? I wrote this after someone asked for help moving more than 200 packages.Andy</description><pubDate>Wed, 20 Mar 2002 11:09:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>moving DTS packages is as easy as using save-as and picking the other server... </description><pubDate>Wed, 20 Mar 2002 10:26:00 GMT</pubDate><dc:creator>retreif</dc:creator></item><item><title>RE: Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Red Gate Software are working on a new product to help people out in comparing and synchronizing the different settings between different SQL Servers. It will be called SQL Server Compare. It will compare DTS packages, logins, jobs and server settings. The idea is to save DBAs who have to administer and set up multiple SQL Servers a whole load of time. It should be launched before the end of April. People interested in the Beta (and in influencing what functionality we include) please contact us at: sqlservercompare@red-gate.comCheers,Simon Galbraith </description><pubDate>Mon, 18 Mar 2002 07:28:00 GMT</pubDate><dc:creator>Simon Galbraith</dc:creator></item><item><title>Copying DTS Packages To a Different Server</title><link>http://www.sqlservercentral.com/Forums/Topic3063-29-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF=&lt;A HREF=http://www.sqlservercentral.com/columnists/awarren/copyingdtspackagestoadifferentserver.asp&gt;http://www.sqlservercentral.com/columnists/awarren/copyingdtspackagestoadifferentserver.asp&lt;/A&gt;&gt;&lt;A HREF=http://www.sqlservercentral.com/columnists/awarren/copyingdtspackagestoadifferentserver.asp&gt;http://www.sqlservercentral.com/columnists/awarren/copyingdtspackagestoadifferentserver.asp&lt;/A&gt;&lt;/A&gt;</description><pubDate>Sat, 16 Mar 2002 00:00:00 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item></channel></rss>