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.
VBdotnet2005Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

k_murli_krishnaCommented:
At command line or shell prompt, use pipe or redirection operator > to create a file and >> to append to existing one. In SSIS, try these references:

SSIS: Exporting data to a text file using a package
http://decipherinfosys.wordpress.com/2008/07/23/ssis-exporting-data-to-a-text-file-using-a-package/
SSIS: Flat File Destination - How To Append Data?
http://www.eggheadcafe.com/software/aspnet/33177109/ssis-flat-file-destinati.aspx
SSIS: Adding footer row to a flat file already containing data
http://database.ittoolbox.com/groups/technical-functional/sql-server-l/ssis-adding-footer-row-to-a-flat-file-already-containing-data-3178205#M3178257
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Reza RadConsultant, TrainerCommented:

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


0
Reza RadConsultant, TrainerCommented:
let me know where in the above steps you have problem exactly and I explain more in details.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

VBdotnet2005Author Commented:
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.
0
Reza RadConsultant, TrainerCommented:
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.
0
Reza RadConsultant, TrainerCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.