A printing problem in OSQL

  • HI

    i have a strange problem.

    im using th OSQL to print to a file

    the is the command:

    OSQL -S serverName -Q"exec PrintToFile" -E -o test.txt

    the 'PrintToFile' procedure simply prints every line in table  using a format i built: ( it uses the PRINT function )

    Example:

    Path:  ( a column )

    .....

    c:\asdasd\......\asdasd.x

    c:\asdassss\qqqsd\asdasdf\qwerftdva\asdfsdfsdf\ff.x

    ......

    Print should look like this: ( in test.txt )

    .....

    Path: c:\asdasd\asdasd.x

    Path: c:\asdassss\qqqsd\asdasdf\qwerftdva\asdfsdfsdf\ff.x

    ......

     

    the command works - i get my file in the correct format

    but for some reason - when the it prints a long string ( about 200 chars ):

    it writes the string in 2 lines.

    Example:

    Path: c:\asdasd\asdasd.x

    Path: c:\asdassss\qqqsd\asdasdf\   ( // ??????? )

    qwerftdva\asdfsdfsdf\ff.x

     

    Does any1 know y this happens or is there a better way to print formatted rows into  file ?????

     

     

  • Take a look at Books Online for the OSQL command... the problem is that the default output is set to 80 characters and you must invoke the "-w" parameter with the desired width setting to get full lines.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • it works

     

    thx

  • Outstanding... thank you for the feedback.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply