dbTalk Databases Forums  

DTS Tools...which one?

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


Discuss DTS Tools...which one? in the microsoft.public.sqlserver.dts forum.



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

Default DTS Tools...which one? - 01-07-2004 , 02:42 PM






i have to export customer sales data into a text file.

the file name has to be the customer ID ==> 123456.txt
the first line has to be the customer ID followed by the
sales data.

123456
415.25
666.90
-25.32
996.21 and so on...

can i use one of the DTS tools - not the wizard - it has
to be done on a schedule.

thanks,
lynn.


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

Default Re: DTS Tools...which one? - 01-08-2004 , 02:41 AM






Setting the filename would be done using a variation of

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

I would go with an export to two text files

1. Has the CustomerID and
2. The other has the sames data

You marry them up at the end using

COPY Header.txt + Data.txt MyFile.txt

You can do this using the Execute Process task and manipulating it

How to manipulate the Execute Process task.
(http://www.sqldts.com/default.aspx?251)

Getting the sales data could be done using a loop through a rowset

How to loop through a global variable Rowset
(http://www.sqldts.com/default.aspx?298)


Why do you need the CustomerID inside the file if you have it as part of the
filename?
You could simply parse the filename at the other end if you needed it.

Scheduling is done through SQL Server Agent so no problems there.

--

----------------------------

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


"Lynn Pennington" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
i have to export customer sales data into a text file.

the file name has to be the customer ID ==> 123456.txt
the first line has to be the customer ID followed by the
sales data.

123456
415.25
666.90
-25.32
996.21 and so on...

can i use one of the DTS tools - not the wizard - it has
to be done on a schedule.

thanks,
lynn.




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.