Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Write to txt file

I am very new to SSIS. What I want to do is to query, then write each record to text files.
Sample : record 1, account # 123, create a file called 123.txt and then write the rest of the data in this format

customername | Jim Thompson
address           | 123 S. La Cruz
city                  | San Francisco, ca 95555

etc
 
         Record # 2   account # 345  create text file called  345.txt and write the rest like above.
ASKER CERTIFIED SOLUTION
Avatar of k_murli_krishna
k_murli_krishna
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Reza Rad

you need to create new SSIS project

add a DATA FLOW TASk
add a oledb data source and connect it to your database(for example sql serever datebase)
add a Flat File destination for your text file
set mappings

and then everything will be fine
you could set delimiter type, set type of text file: delimiter, fixed width or ragged right


let me know where in the above steps you have problem exactly and I explain more in details.
Avatar of VBdotnet2005

ASKER

reza_rad
Your steps above write to a fle? I want it write each record(above format)on each text file. Your help is greatly appreciated.
no actually,
the steps above will write each record in one line of text file.
if you want to change the way of writing to text file as above(which is familiar to me from your previous questions), you should use Script Component Transformation between source and destination.

if you need more detailed help,provide a sample table data, and also a sample requested result with more than one row data.
Did you got the answer to your question ??!!!!!!!!!!!!
I think you can not do this without script component transformation. you should read this format in script and make your output rows in code.