INF: ISQL Output to a Text File Will Wrap Lines Longer Than 733

Last reviewed: March 4, 1998
Article ID: Q182021
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5

SUMMARY

When you direct isql output to a text file, you are limited to 733 characters per line. The remainder of the line follows a cr/lf/tab (control, line feed, tab). A column does not split; that is, the output will break wherever it is needed to ensure that a column's output is not split across the lines. Thus if you direct the output as char(255), char(255), char(230), the result is a break at 510 characters with the remaining 230 characters on the second line.

MORE INFORMATION

The following scenario demonstrates this behavior.

drop table isqltest go create table isqltest (col1 char(255), col2 char(255), col3 char(200), a char(20), b char(1), c char(1), d char(1), e char(1)) go insert isqltest values('1234567890123456789012345678901234567890123456789012345678901234567 890123456789012345678901234567890123456789012345678901234567890123456789012 345678901234567890123456789012345678901234567890123456789012345678901234567 89012345678901234567890123456789012345','1234567890123456789012345678901234 567890123456789012345678901234567890123456789012345678901234567890123456789 012345678901234567890123456789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234567890123456789012345','1 234567890123456789012345678901234567890123456789012345678901234567890123456 789012345678901234567890123456789012345678901234567890123456789012345678901 2345678901234567890123456789012345678901234567890','AAAAAAAAAAAAAAAAAAAA',' A','A','A','A') insert isqltest values('1234567890123456789012345678901234567890123456789012345678901234567 890123456789012345678901234567890123456789012345678901234567890123456789012 345678901234567890123456789012345678901234567890123456789012345678901234567 89012345678901234567890123456789012345','1234567890123456789012345678901234 567890123456789012345678901234567890123456789012345678901234567890123456789 012345678901234567890123456789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234567890123456789012345','1 234567890123456789012345678901234567890123456789012345678901234567890123456 789012345678901234567890123456789012345678901234567890123456789012345678901 2345678901234567890123456789012345678901234567890','AAAAAAAAAAAAAAAAAAAA',' A','A','A','A') insert isqltest values('1234567890123456789012345678901234567890123456789012345678901234567 890123456789012345678901234567890123456789012345678901234567890123456789012 345678901234567890123456789012345678901234567890123456789012345678901234567 89012345678901234567890123456789012345','1234567890123456789012345678901234 567890123456789012345678901234567890123456789012345678901234567890123456789 012345678901234567890123456789012345678901234567890123456789012345678901234 56789012345678901234567890123456789012345678901234567890123456789012345','1 234567890123456789012345678901234567890123456789012345678901234567890123456 789012345678901234567890123456789012345678901234567890123456789012345678901 2345678901234567890123456789012345678901234567890','AAAAAAAAAAAAAAAAAAAA',' A','A','A','A') go

The isql command to execute:

ISQL /n /h-1 /Sa_pkalba1 /d pubs /U sa /P /w 740 /s /Q "Select * from isqltest" /o isqltest.txt

The output in isqltest.txt appears as:

123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 67890123456789012345678901234567890AAAAAAAAAAAAAAAAAAAAAAA

   A
123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 67890123456789012345678901234567890AAAAAAAAAAAAAAAAAAAAAAA
   A
123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 678901234567890123456789012345678901234567890123456789012345123456789012345 678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345 67890123456789012345678901234567890AAAAAAAAAAAAAAAAAAAAAAA
   A

(3 rows affected)
Keywords          : SSrvISQL
Version           : WINNT:6.0,6.5
Platform          : winnt
Issue type        : kbinfo


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 4, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.