I'm getting a carriage return in my output file after each of my select statements and I don't want the carriage return.
c:\Illinois_temp.sql is basically a command file that contains the following:
----------------------------------------------------------
set nocount on
select hdr from Illinois_Cig_Return where Illinois_CigReturn.row = 1
select records from Illinois_Cig_Return where not (Illinois_Cig_Return.records is null) order by Illinois_Cig_Return.row
select eof from Illinois_Cig_Return where not (Illinois_Cig_Return.eof is null)
-----------------------------------------------------------
The first select statement gets one record. The second select statement will get many records and the third select statement gets one record. My output which is below has a carriage return (and possibly a line feed) after each select statement has been processed and I don't want it there.
I run a query that contains these 2 statements and uses the c:\Illinois_temp.sql file:
set @cmd = 'osql -i"c:\Illinois_temp.sql" -E -s -h-1 -d"Order" -w641 -n ' +
'-o' +
@folder +
@file
exec @cmdshell_result = master..xp_cmdshell @cmd,no_output
-----------------------------------------------------------
My output file looks like this:
*************HDR19E18RC6A M
2020000022124500
3030000122124500
3600000122124500
*************EOF00000016
Any suggestions?
c:\Illinois_temp.sql is basically a command file that contains the following:
----------------------------------------------------------
set nocount on
select hdr from Illinois_Cig_Return where Illinois_CigReturn.row = 1
select records from Illinois_Cig_Return where not (Illinois_Cig_Return.records is null) order by Illinois_Cig_Return.row
select eof from Illinois_Cig_Return where not (Illinois_Cig_Return.eof is null)
-----------------------------------------------------------
The first select statement gets one record. The second select statement will get many records and the third select statement gets one record. My output which is below has a carriage return (and possibly a line feed) after each select statement has been processed and I don't want it there.
I run a query that contains these 2 statements and uses the c:\Illinois_temp.sql file:
set @cmd = 'osql -i"c:\Illinois_temp.sql" -E -s -h-1 -d"Order" -w641 -n ' +
'-o' +
@folder +
@file
exec @cmdshell_result = master..xp_cmdshell @cmd,no_output
-----------------------------------------------------------
My output file looks like this:
*************HDR19E18RC6A M
2020000022124500
3030000122124500
3600000122124500
*************EOF00000016
Any suggestions?