Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|improve this answer
    
Thanks, that works. –  ProfK Sep 19 '09 at 7:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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