dbTalk Databases Forums  

DTS Package, Export multiple time to a CSV

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


Discuss DTS Package, Export multiple time to a CSV in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
computer_prog@hotmail.com
 
Posts: n/a

Default DTS Package, Export multiple time to a CSV - 08-10-2005 , 10:32 AM






I am designing a DTS package and I wanted my package to export multiple
data items to a CSV file. I am using multiple "Transform Data Tasks"
from my SQL connection to a Text File connection. The problem I am
having is everytime the package runs a Transform Data Task it
overwrites the data in the CSV and I only get the last data task. I
did try setting the proper Precedence in the workflow properties. No
matter what I try I cannot get a Data task to append to the CSV, it
only overwrites.

If I change the output connection to an Excel object I can get multiple
data tasks to append properly to an Excel file so I know that my logic
is correct. I really need a CSV file and I cannot get this to work
properly. Does anyone know how to get multiple data tasks to write to
a single CSV file?


Reply With Quote
  #2  
Old   
Vishal Parkar
 
Posts: n/a

Default RE: DTS Package, Export multiple time to a CSV - 08-10-2005 , 02:50 PM






Create 3 different output files.
Append the 3 output files to the 4th with the help of DOS commands.

ex:
Create a batch file with following commands.(ex: test.bat)


type c:\test.csv > c:\test3.csv
type c:\test2.csv >> c:\test3.csv


Run the above batch file inside "Execute Process Task"
above commands will append the output of 2 files test.csv and test2.csv into
a file called test3.csv


--Vishal

"computer_prog (AT) hotmail (DOT) com" wrote:

Quote:
I am designing a DTS package and I wanted my package to export multiple
data items to a CSV file. I am using multiple "Transform Data Tasks"
from my SQL connection to a Text File connection. The problem I am
having is everytime the package runs a Transform Data Task it
overwrites the data in the CSV and I only get the last data task. I
did try setting the proper Precedence in the workflow properties. No
matter what I try I cannot get a Data task to append to the CSV, it
only overwrites.

If I change the output connection to an Excel object I can get multiple
data tasks to append properly to an Excel file so I know that my logic
is correct. I really need a CSV file and I cannot get this to work
properly. Does anyone know how to get multiple data tasks to write to
a single CSV file?



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.