Use the BCP command of sqlserver to import data two days ago. The column separator is [!]. The row delimiter is [end]. Because the two characters have special meanings and need to be escaped, after querying the data, it is found that the prefix of the BCP escape is not easy to use, which is ^ .. The detailed command is as follows: BCP [database]. dbo. [table] inC: dataimp3table.txt. out-t ^ [!] ^-R ^ [end] ^-
Use the BCP command of sqlserver to import data two days ago. The column separator is [!]. The row delimiter is [end]. Because the two characters have special meanings and need to be escaped, after querying the data, it is found that the prefix of the BCP escape is not easy to use, which is ^ .. The detailed command is as follows: BCP [database]. dbo. [table] in C: \ dataimp3 \ table.txt. out-t ^ [!] ^-R ^ [end] ^-
Use the BCP command of sqlserver to import data two days ago. The column separator is <[!]> The row delimiter is <[end]>. Because the <> two characters have special meanings and need to be escaped, after querying the data, it is found that the prefix of the BCP escape is very difficult. It is ^ .. The detailed commands are as follows:
BCP [database]. dbo. [table] in C: \ dataimp3 \ table.txt. out-t ^ <[!] ^>-R ^ <[end] ^>-c-B 15000-S 192.168.49.121-U sa-P password
Another solution is to add double quotation marks to all fields with special characters.
BCP [database]. dbo. [table] in "C: \ dataimp3 \ table.txt. out"-t "<[!]> "-R" <[end]> "-c-B 15000-S 192.168.49.121-U sa-P password
You can use 0x0A to indicate linux newline \ n.