dbTalk Databases Forums  

Executing DTS package from the command line

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Executing DTS package from the command line in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeigh
 
Posts: n/a

Default Executing DTS package from the command line - 03-04-2004 , 11:13 AM






Hi.

Is there a way to execute a DTS package from the command line?

Let me describe the scenario:

I have a bunch of files that are generated by another computer that have
their own format. I also have a program called "decode" that decodes these
files and puts them into a text file labeled 1.txt

I created a DTS package that will take the comma delimited text file and
import the data into a database. I want to automate the whole process so
that the system will continue to operate without my daily intervention...

To accomplish this, I want to make a .BAT file, and make it a scheduled
task. It needs to do the following:
1) Grab the files from an ftp server
2) DECODE the files and output to 1.txt
3) Move the file to another folder (so it isnt decoded again when the
loop repeats the next day)
4) Run a DTS package that will import the data from 1.txt into a table
5) delete 1.txt

The only problem that I have is with step #3. Can anyone help me with
this?

Thanks in advance,

-- Jason


ps... If its possible to schedule all 5 of these steps in SQL server,
thereby eliminating the use of bat files, I'd be willing to hear anything
that anyone has to say about that.



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Executing DTS package from the command line - 03-04-2004 , 12:35 PM






You can use MOVE on the command line

You can also use the FileSystemObject and .MoveFile

Yes DTS can be run on the cmdline (DTSRUN)




--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Jeigh" <folkens.jason (AT) acd (DOT) net> wrote

Quote:
Hi.

Is there a way to execute a DTS package from the command line?

Let me describe the scenario:

I have a bunch of files that are generated by another computer that have
their own format. I also have a program called "decode" that decodes
these
files and puts them into a text file labeled 1.txt

I created a DTS package that will take the comma delimited text file and
import the data into a database. I want to automate the whole process so
that the system will continue to operate without my daily intervention...

To accomplish this, I want to make a .BAT file, and make it a scheduled
task. It needs to do the following:
1) Grab the files from an ftp server
2) DECODE the files and output to 1.txt
3) Move the file to another folder (so it isnt decoded again when the
loop repeats the next day)
4) Run a DTS package that will import the data from 1.txt into a table
5) delete 1.txt

The only problem that I have is with step #3. Can anyone help me with
this?

Thanks in advance,

-- Jason


ps... If its possible to schedule all 5 of these steps in SQL server,
thereby eliminating the use of bat files, I'd be willing to hear anything
that anyone has to say about that.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.