LearnItFirst User Forum

New SQL Server 2008 DBA Course
Welcome Guest Search | New Posts | Members | Log In | Register

How to Copy DTS Packages from One SQL Server to Another Using BCP Options
Scott Whigham
Posted: Monday, August 28, 2006 11:01:07 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 460
Points: 1,002
Where do you live?: Dallas, TX
Code:
/*
    Author: Scott Whigham from http://www.LearnSqlServer.com/

    Description: Migrates DTS packages stored in msdb to a text file (binary format) which is then loaded into a
         target SQL Server using bcp. This is only one option; there are others...
   
    Versions: SQL Server 2000 only
   
    Creation Date: August 28, 2006

    For more scripts like this one, visit http://forums.learnsqlserver.com/codesamples.aspx
*/

-- Run this on the source SQL Server
EXEC master.dbo.xp_cmdshell "bcp msdb.dbo.sysdtspackages out c:\DTS_Packages.txt -c"

-- Copy the .txt file to the target (destination) server
-- Now log into the destination server and run this:
EXEC master.dbo.xp_cmdshell "bcp msdb.dbo.sysdtspackages in c:\DTS_Packages.txt -c"
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.