你看过-C吗?
-C { ACP | OEM | RAW | code_page }
Specifies the code page of the data in the data file. code_page is
relevant only if the data contains char, varchar, or text columns
with character values greater than 127 or less than 32.
鉴于您的表的数据类型是 Unicode (NVARCHAR),您还必须使用 -c(可能会丢失一些 Unicode 字符)
-c
Performs the operation using a character data type. This option
does not prompt for each field; it uses char as the storage type,
without prefixes and with \t (tab character) as the field
separator and \r\n (newline character) as the row terminator. -c
is not compatible with -w.
For more information, see [Use Character Format to Import or
Export Data (SQL Server)].
CREATE TABLE [dbo].[Test] (
[test] [nvarchar](100) NOT NULL
);
INSERT [dbo].[Test] ([test]) VALUES (N'helló wórld');
bcp dbo.Test out dbo.Test.dat -c -T -C ACP
-w 没有 -c 和 -C ACP 也应该可以工作,只要 Notepad++ 可以检测到编码(UCS-2 Little Endian)。我使用 Notepad++ 6.7.7 的简单示例没有问题。
来源:https://msdn.microsoft.com/en-us/library/ms162802.aspx