JElster
asked on
How to export BCP with Pipe Delimiter
Hi..
What is the syntax to export with a pipe '|' as delimiter
this if for CSV or comma
set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t, -T'
exec master..xp_cmdshell @s
What is the syntax to export with a pipe '|' as delimiter
this if for CSV or comma
set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t, -T'
exec master..xp_cmdshell @s
ASKER
field
Then is the first solution. You defined as comma so you just need to change it to pipe.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Field delimiter: set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t ¦ -T'
Row terminator: set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t, -T -r ¦'