批量插入,带有特殊字符作为分隔符

时间:2017-11-03 12:04:41

标签: sql sql-server

我正在尝试使用特殊字符作为字段终止符批量插入。

我的输入文件如下所示;

enter image description here

ASCII:254是字段引用,ASCII:020是字段终止符。

SQL Server版本是11.0.5058.0

到目前为止我的代码;

bulk
INSERT edMe.dbo.test
FROM 'H:\test.dat' WITH (fieldterminator = 'þþ',
                      rowterminator = '\n',
                      datafiletype = 'widechar',
                      codepage ='acp'
                      )

但是,插入了0条记录;

Bulk load: DataFileType was incorrectly specified as widechar. DataFileType will be assumed to be char because the data file does not have a Unicode signature.
Bulk load: DataFileType was incorrectly specified as widechar. DataFileType will be assumed to be char because the data file does not have a Unicode signature.

(0 row(s) affected)

由于

0 个答案:

没有答案