Blank Line at the end of query output

  • I have a batch file which does the following:

    1. Uses the isql utility to executes a stored procedure which extracts some data and stores it in a table.

    2. Uses the isql utility again to read data from this table using a SELECT statement and outputs the result to a text file.

    My problem is that a blank line is included at the end of this file. I am using SQL Server 2000.

    Is there any way to remove this extra blank line from this file?

    I was getting two blank lines initially. I used the following code and now am left with one blank line

    @Echo OFF

    for /F "tokens=* delims=" %%G in (C:\TempInput.txt) do @echo %%G >> C:\TempOutput.txt

  • What problem does the blank line cause you?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • [font="Arial"]

    Hello,

    You should be using the bcp utility to output the data from the table built by the isql programming.

    Regards,

    Terry

    [/font]

  • You really shouldn't use ISQL.exe... use OSQL.exe instead. Also, as suggested, BCP is likely the way to go here.

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