问题描述
我想弄清楚为什么我使用的 BULK INSERT 命令无法识别命令中使用的 FORMAT 和 FIELDQUOTE 选项.
I'm trying to figure out why the BULK INSERT command I'm using isn't recognizing the FORMAT and FIELDQUOTE options used in the command.
BULK INSERT dbo.tblM2016_RAW_Current_Import_File
FROM '\\x\tms\SCADA.dat'
WITH
(
FIRSTROW = 1,
FORMAT = 'CSV',
FIELDQUOTE = '"',
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
出于某种原因,我收到错误消息:
For some reason, I'm getting the error:
消息 102,级别 15,状态 1,第 6 行
FORMAT"附近的语法不正确.
Addition:FORMAT
在SSMS中以粉红色文本显示,FIELDQUOTE
以黑色文本显示,其他以蓝色文本显示.由于某种原因,该命令似乎无法将 FORMAT
和 FIELDQUOTE
识别为关键字.
Addition: FORMAT
shows up in pink text in SSMS, FIELDQUOTE
shows in black text, the others show in blue text. It seems the command isn't recognizing FORMAT
and FIELDQUOTE
as keywords for some reason.
推荐答案
FORMAT
和 FIELDQUOTE
说明符在生产服务器中尚不可用.
The FORMAT
and FIELDQUOTE
specifiers are unfortunately not yet available in production servers.
根据文档:
输入文件格式选项FORMAT = 'CSV'
适用于: SQL Server vNext CTP 1.1.
指定符合 RFC 4180 标准的逗号分隔值文件.
FIELDQUOTE = 'field_quote'
适用于: SQL Server vNext CTP 1.1.
FIELDQUOTE = 'field_quote'
Applies to: SQL Server vNext CTP 1.1.
注意:此答案截至 2017 年 2 月 13 日是最新的.在某个时候,SQL Server vNext"将不再是 CTP 并成为生产服务器.然而,问题与 SQL Server 2016 相关,因此缺少这些功能.
NOTE: This answer is current as of 13th of february 2017. At some point "SQL Server vNext" will cease to be CTP and become production server. The question, however, is in relation to SQL Server 2016 which thus lacks these features.
这篇关于BULK INSERT 格式附近的语法不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!