I Need To Remove Blank Lines At End Of SQL Query
Posted on 2007-07-26
I am running the following OSQL command that outputs data to a file:
osql -dION_Data -E -ieaf8.sql -l -n -oeaf8.txt -s"<TAB>" -SMAPOW\ION -w500 -h-1 -m1000
This data file is read by another program (that I cannot change) and only expects rows of tab delimited data.
I am using the -m parameter to suppress the errors/warnings.
I am also using the "set nocount on;" command in the input file.
The problem is there is always 2 <CR><LF> at the end of the file. Is there a way to get rid of this using OSQL, or within the SQL query? If not is there an easy way to do this from DOS?
On a side note, is there a defined error # range to use for the -m parameter? I just picked 1000 out of thin error...