Link to home
Start Free TrialLog in
Avatar of JElster
JElsterFlag for United States of America

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
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Delimiter for what? Field or row?
Field delimiter: set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t ¦ -T'
Row terminator: set @s = 'bcp "'+ @SQL + '" queryout ' + @FilePath + ' -c -t, -T -r ¦'
Avatar of JElster

ASKER

field
Then is the first solution. You defined as comma so you just need to change it to pipe.
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial