SQL Server Performance

ISQL - Print more than 256 characters on a line

Discussion in 'T-SQL Performance Tuning for Developers' started by nbkr3bi, May 14, 2007.

  1. nbkr3bi New Member

    I am using isql to execute a stored procedure and write the output to a file.
    I need the output to be on a single line. however the output beyond 256 characters is getting truncated even though i am using -w500 switch
    isql -Uabc -Pabc -dDesktop -SMyserver -Q "exec MyProc" -o D:appslogout.txt -n -w300
    Any pointers??
  2. satya Moderator

    Are you using PRINT statement in that stored procedure?
    Unfortunately PRINT always wraps at 256 characters, and SELECT always has a blank line between results in the output.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
  3. nbkr3bi New Member

    I am using select only but still it wraps at 256 characters. I dont mind a blank line at the end of the output.
    I am using -n -w300 switches
  4. satya Moderator

    Why don't you take help of BCP in this case, it will do the work.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
  5. nbkr3bi New Member

    Okay, i managed to make it work <img src='/community/emoticons/emotion-1.gif' alt=':)' /><br />ISQL truncates all varchar data to 255 chars, so i converted it to text using CONVERT function and it worked<br />Thanks to everyone for their help

Share This Page