Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

how to produce two text files one with path and second is actual content from the sql server table

$
0
0

Good Evening,

please help me with your valuable ideas,

i have a table with 9873 rows in it, 10 columns in a table, all columns were having datatype as nvarchar(255) except a column called EmailBody which is nvarchar(max),  it need not be what it is now, it can be changeable (if any issues) if it require in some ssis transformations.

the source could be a sql server table, or i can create a textfile from the table for source feed to ssis package

1)each  EmailBody column value will be saved into a text file and save to disk

2) a text file with all rows in the source/table with pointer (path) to step 1 created file 

so to be clear, if i have 5 rows , i will end up with 5 email body text files (column always have values will be never empty) and then another text file (masterfile) with all rows info and each row will have pointer to above created 5 files.

for example

expected outcome in master file will be as below (instead email body column it wlill have email body extracted and saved to txt path) as in first step

123,"king@gbh.com","virat@live.com","Ctire@lie.co","jan-12-2012","jbh office","king","yes","5","C:\ssis\emailbody\1726366.txt"
123,"king@gbh.com","virat@live.com","Ctire@lie.co","feb-23-2012","jbh office","king","yes","4","C:\ssis\emailbody\1726367.txt"
124,"bong@ltd.com","singa@sim.com","NULL","mar-1-2012","bbk client","ginj","no","3","C:\ssis\emailbody\1726368.txt"
134,"jack@king.com","jaybol@jay.com","NULL","apr-12-2012","horiz","king    no","4","C:\ssis\emailbody\1726369.txt"
127,"pck@jij.com","jinh@kin.co","bing@jik.com","jun-8-2012","ventura","linh","yes","2","C:\ssis\emailbody\1726370.txt"

please share your valuable ideas with me,

please again, just did derived column and with export column, i am getting outcome of text file per row, but dont know how to start for master file

or let me know is there any better ways that what i am doing now

Thanks in advance

asitti


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>