How do I go about exporting SQL Server 2005 tables to a fixed length field text file, with one record per line? SQL seems to think fixed length is the only way to delimit records, i.e. fieldLen1 + fieldLen2 + ... + fieldLenN = recLen. I can't find any way of delimiting each record with a newline.

Also, when I tried the wizard from a normal DB engine connection, it puked on a column name called "ShortLocation". I fail to see what could be difficult about writing that out to a text file, but I gave up on the wizard and am trying a SSIS package, but as soon as I make the format "Fixed Width" I lose the row delimiter option.

Surely my requirement is not that unheard of?

link|improve this question

61% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Try the 'ragged right' option mentioned here :

http://weblogs.asp.net/guystarbuck/archive/2008/01/31/ssis-flat-file-export-quot-fixed-width-quot-vs-quot-ragged-right-quot.aspx

link|improve this answer
Thanks, that works. – BradyKelly Sep 19 '09 at 7:58
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.