473,382 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How do I Copy back in a DTS script?


Hi !
I know how to save a DTS as a structured storage file and how to
recreate a DTS using that file.
What I can't find is a command, either in t-sql or from a DOS level,
with which I can save the DTS as a structured storage file, for example
in a scheduled job for backup purposes.

Hopefully some out there has an answer !!!

Thanks
David Greenberg
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
2 3631

"David Greenberg" <da*****@iba.org.il> wrote in message
news:40***********************@news.frii.net...

Hi !
I know how to save a DTS as a structured storage file and how to
recreate a DTS using that file.
What I can't find is a command, either in t-sql or from a DOS level,
with which I can save the DTS as a structured storage file, for example
in a scheduled job for backup purposes.

Hopefully some out there has an answer !!!

Thanks
David Greenberg
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


If I understand you correctly, probably the easiest way to do this is with
the SQLDMO object model - you can use the Package2 object's
LoadFromSQLServer method followed by the SaveToStorageFile method to do what
you want. So you could write a script in VBScript, Perl etc., or perhaps
look at the sp_OA% procedures if you need to do this from TSQL (although
there are security issues for non-sysadmins using those procs).

Also make sure you are backing up msdb, which is where DTS packages stored
in SQL Server are located - that might be enough, depending on your
requirements.

Simon
Jul 20 '05 #2
To add to Simon's response, below is a VBScript code snippet that will copy
a package from a SQL Server repository to a structured storage file.

SqlServerName = "MyServer"
DtsPackageName = "MyPackage"

Set Fso = CreateObject("Scripting.FileSystemObject")
Set DtsPackage = CreateObject("DTS.Package2")

'get package
DtsPackage.LoadFromSqlServer
SqlServerName, , , 256, , , , DtsPackageName

'generate file name
DtsPackageFileName = "C:\MyDtsPackages\" & _
DtsPackage.Name & ".dts"

'delete file if it already exists
If Fso.FileExists(DtsPackageFileName) Then
Fso.DeleteFile DtsPackageFileName
End If

'create structured storage file
DtsPackage.SaveToStorageFileAs _
DtsPackage.Name, _
DtsPackageFileName
--
Hope this helps.

Dan Guzman
SQL Server MVP

"David Greenberg" <da*****@iba.org.il> wrote in message
news:40***********************@news.frii.net...

Hi !
I know how to save a DTS as a structured storage file and how to
recreate a DTS using that file.
What I can't find is a command, either in t-sql or from a DOS level,
with which I can save the DTS as a structured storage file, for example
in a scheduled job for backup purposes.

Hopefully some out there has an answer !!!

Thanks
David Greenberg
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sqlnewbie | last post by:
I'm a newbie to script writing. I'm trying to write a script to copy all data from a table to the same table in a 2nd database. Both databases are on the same server and are identical in design. ...
4
by: David | last post by:
Hi, I hope this is the correct place for this post. I have an asp page with a form. The form has 2 text boxes for entering a serial number range. first serial & last serial In a variable...
9
by: David Rysdam | last post by:
I have a large amount of data that I copy in and out of Sybase very often. Now I also want to copy this data in and out of postgres. I have an existing script that creates the entire database(s)...
0
by: Robert Fitzpatrick | last post by:
I have a PHP script that was having problems using the COPY command with files around 1500 lines in size. The script will build the copy data from incoming CSV file into a temp file, then start a...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
5
by: kebuchan | last post by:
Hi all, I know this is possible in Oracle but has anyone done it in DB2 and could you maybe direct me to some documentation or let me know how I would go about doing it? In the oracle world...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
2
by: Matthew Moran | last post by:
I posted this on the .asp group but believe this may be a more appropriate forum. I have a need to have a web server (windows based) grab files each week from a linux based server - hosted...
1
by: Matthew Moran | last post by:
I have a need to have a web server (windows based) grab files each week from a linux based server - hosted elsewhere. I cannot use UNC paths. I want to have a script (.asp/asp.net) on the...
2
by: jerrygarciuh | last post by:
Hi all, The following script is giving me weird problems. I have in this directory an index.php and hurricane.php. If the script gets $i = 'on' it is supposed to back up the current index...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.