Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

Try the 'ragged right' option mentioned here :

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

Your Answer


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.