473,569 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3638

"David Greenberg" <da*****@iba.or g.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
LoadFromSQLServ er method followed by the SaveToStorageFi le 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("S cripting.FileSy stemObject")
Set DtsPackage = CreateObject("D TS.Package2")

'get package
DtsPackage.Load FromSqlServer
SqlServerName, , , 256, , , , DtsPackageName

'generate file name
DtsPackageFileN ame = "C:\MyDtsPackag es\" & _
DtsPackage.Name & ".dts"

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

'create structured storage file
DtsPackage.Save ToStorageFileAs _
DtsPackage.Name , _
DtsPackageFileN ame
--
Hope this helps.

Dan Guzman
SQL Server MVP

"David Greenberg" <da*****@iba.or g.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
10995
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. I can do this with DTS but wanted a script I could email to a user to run in Query Analyzer. Example: Copy entire table called 'Customers' in...
4
2959
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 on the asp page I have a quantity. What I want is that when the user enters a serial number in the first
9
9996
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) from scratch in Sybase and then uses the Sybase bulk copy tool "bcp" to copy the data in. I already did a brute force port of this script to...
0
2743
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 COPY command and loop through the copy data using pg_put_line to insert and then pg_end_copy after posting the last line as '\.'. Worked well under...
9
2405
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 when I give a path like @"C:\holdfiles\myfile.txt" it looks on the server C drive. How do I pull from the client? Do I need a different class and/or...
5
3102
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 you would basically need to do the following: 1. Set tablespace to backup mode 2. Copy associated data files to new directory/system
8
2563
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 the folder does not exsist, create folder "www" and then copy folder "temp" and its contents. If the folder "www" is there, look in it, check to...
2
4511
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 elsewhere. I cannot use UNC paths. I want to have a script (.asp/asp.net) on the windows server that I would provide a list of files to copy. The...
1
2167
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 windows server that I would provide a list of files to copy. The script would then copy the listed files. The problem is that the using a filestream...
2
1611
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 into a file called normal.php and then copy hurricane.php into index.php. This should create a backup of the index and then put the hurrican alert in...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.