can I stop OSQL output from wrapping?

  • I'm trying to use OSQL to export the result of a query to a text file. It's working nicely, but outputs each record as several lines, each 80 characters. I'd like to have each record as one line. I'm invoking an OSQL statement from a batch file. How do I go about doing that? Is there a specific parameter to do this?

     

    Example OSQL:

    osql -U myuser -P mypw -d mydbname -b -Q "PAT_API DEF, LMRWV020"  -o D:\PAT\Output\DVRLL.txt

     

    tia,

     

    Russ

     

  • Start with a joke (sort of)

    Q: What is the best kind of rock to pound in screws ?

    A: Granite

    The correct answer is of course, not to use a rock but a screwdriver.

    So the anwers to your question is not to use OSQL but to use Data Transformation Services.

    SQL = Scarcely Qualifies as a Language

  • Thanks for the quick reply,

     

    I used OSQL because what I am executing is a stored procedure and I did not see a way to supply the stored procedure name as a parm in the DTS Execute SQL task. DTS did not like me using

    exec ? ? in the SQL

    The first ? would be the stored procedure name supplied in the DTSRUN command with parm /A

    Is there another task I should be using in DTS to handle this

     

     

  • Try using the -w switch to control the width of the output.

     

  • thanks! the -w took care of my problem

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

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