The following is the batch file I am using to create a "CSV" output from two SQL tables:
bcp "select * from livedb.dbo.tbl_RCA_DAILY_ATB_HEADERS" queryout "P:\ACCOUNTING\RCA_DAILY_HEADERS.csv" -T -SPTM-DR01 -w -t^|
bcp "select * from livedb.dbo.tbl_RCA_ATB_DAILY" queryout "P:\ACCOUNTING\RCA_ATB_DAILY_Temp.csv" -T -SPTM-DR01 -w -t^|
copy P:\ACCOUNTING\RCA_DAILY_HEADERS.csv + P:\ACCOUNTING\RCA_ATB_DAILY_Temp.csv P:\ACCOUNTING\CHI\DailyATB\rca_p1_mt_daily_accts_"%date:~10,4%%date:~4,2%%date:~7,2%.csv
The code works well, except that the name of the output file results in a "txt" extension. My client require a "pipe" delimited "csv" file.
How can I change the above code to make sure the output works like I need it to?