Export MS SQL Procedure to text/csv file
Posted on 2010-09-17
I have a MS SQL procedure that excepts a single numerical parameter which then produces a single table of results.
I would like to export these result sets to a file so that it can be imported into an existing mysql table.
I am trying to use bcp but it only seems to produce one line and fail, this is the syntax I am using:
bcp "exec cwo.djw.ol_lcd_files 11" queryout "F:\EXPORT_LCD_OFFLINE\venues.csv" -t"," -e "C:\error.log" -c -T -SSERVER -r \r\n
the query should produce about 7000 lines but all I get is one single line like this:
2689,7068,Training 001, , , , , ,,,,, ,,,
Is anyone able to tell me where I am going wrong?