March 7, 2006 at 7:42 am
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,
Nick
March 7, 2006 at 8:10 am
No way I know of in the bcp utility. Maybe script an open and delete of the first line from VBScript?
March 7, 2006 at 8:23 am
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