Export each result row to it's own .doc file
A client would like to pull results from a table and export each row to it's own separate file. I am trying to use SSIS to do this. I have the sql query ready in a data flow task, but I'm not sure how to setup the variables to put each result row into it's own file and then name the file a particular name. The file name will be part of the row result. I am only pulling two fields from a table to get my results. The first field is an ID field which will become the file name. The second field is a data type of text and will go into the .doc file. Any help would be appreciated. Thanks.
December 21st, 2010 10:13am

So if I understand you correctly, you have a SQL table with fields [ID] and [text data] and you want a SINGLE row of this table to be dumped into a single document named [ID] with the document containing [text data]. I think I would handle this with a Data Flow task that sends the two fields to a Script Component. The scripts component would read the two fields and also make use of System.IO to write the data using Steam writer. To be honest, I'm not a VB coder so this part escapes me. But I know that in your code you should be able to create a document with filename of [ID] and then write to that file the contents of field [text data]. Sorry I wasn't much more help.Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2010 10:54am

Thank you. The VB code is the part I have trouble with as well.
December 21st, 2010 11:13am

You don't need scripts at all. Try the Export Column component in your Data Flow. It should fit your bill exactly. Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
December 22nd, 2010 2:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics