OSQL''s -s parameter and TAB

  • OSQL's "-s" parameter accepts a single character to use as column delimiters for any result sets it may produce in it's output and it defaults to space.  I've tried just about everything I know to get it to accept the TAB character (also known as ^I, Char(9), \t, and a couple of other permutations) but no luck, yet.

    Anybody know how to set the -s parameter of OSQL to the TAB character? 

    Yep, I know... could use BCP in the QUERY mode to call a proc or select from a view... but the OSQL thing is bugging me and just wanted to know if there was a solution to setting the -s parameter to a TAB.

    Thanks folks.

    --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)

  • Did you try to be dummy?

    -s"  "

    Enter TAB between quotes using Notepad.

    Somewhere in previous life I read that command prompt is a text editor, so it may work.

    _____________
    Code for TallyGenerator

  • Thanks for trying, Serqiy... the tab gets converted to "~WRF0409.tmp" when pasted back into a CMD window.  Have tried ALT-0-9, Ctrl-I, etc... all have the same effect.  And, haven't been able to find an override for it.

    --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)

  • No, I mean create ".bat" file in Notepad or something like that and run it from cmd.

    _____________
    Code for TallyGenerator

  • Oh... when you said "Did you try to be dummy?", I didn't realize I had to be THAT dumb to get this to work   That worked like a charm, old friend.  Thanks.

    --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)

  • I was just thinking - if such guy like Jeff cannot find the solution it must be something really stupid.

    See - I was right!

    Again.

    _____________
    Code for TallyGenerator

  • Not nearly as stupid as trying to emulate spreadsheets in a database, eh?   Should'a listened to you on THAT one...

    Thanks again, Serqiy.

    --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 7 posts - 1 through 6 (of 6 total)

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