ISQL Export

  • Hi,

    I am using ISQL to export data from a query to a text file. I have constructed the batch below, this works fine.

    @ECHO ON

    SET ISQLPASSWORD=PASSWORDISQL /U SA -S SQLSERVER -d OODB /i MYQUERY.SQL /o MYRESULTS.TXT

    However I dont require columns names or any > - characters in the output. Using the -n switch does not remove them. Please can you tell me how I go about removing them?

    Thanks,


    Kindest Regards,

    Nick

  • No way I know of in the bcp utility. Maybe script an open and delete of the first line from VBScript?

  • Try this:

    OSQL /U SA /P password -S localhost -d master /i MYQUERY.SQL /o MYRESULTS.TXT -n -h-1

    Note that you should use OSQL instead of ISQL and there is no need to set a password variable.  Even better would be to use '-E' instead of /U and /P if possible.  Check out OSQL -? for more information.

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

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