Getting bcp.exe to escape terminators

后端 未结 4 1848
轮回少年
轮回少年 2021-01-17 14:41

I need to export some data using SQL Server 2000\'s BCP utility. Sometimes my data contains characters, such as \\t and \\n, that I need to use as column and row terminator

4条回答
  •  心在旅途
    2021-01-17 14:58

    You can use a separator made up of multiple characters if you put them between double quotes:

    bcp MY_TABLE out C:\MY_FILE.txt -S SERVER_IP -d DB_NAME -U MY_USER -P MY_PASSWORD -w -t "&#)^@" -r ">~+!"

    Found the solution here.

提交回复
热议问题