此处示例csv
"F","00004","GSP"
"X","00000","HPM-KRW","N","ADM","GLA","CCS","CC","WBS ELS","WBS EL","IOS","IO","KS","KC","X"
"X","00001","HPM-KRW","N","ADM","GLA","CCS","CC","WBS ELS","WBS EL","IOS","IO","KS","KC","X"
"X","00002","HPM-KRW","N","ADM","GLA","CCS","CC","WBS ELS","WBS EL","IOS","IO","KS","KC","X"
"X","00003","HPM-KRW","N","ADM","GLA","CCS","CC","WBS ELS","WBS EL","IOS","IO","KS","KC","X"
我的表
CREATE TABLE [dbo].[ITFC_COMBO_DATA]
(
[RECORD_TYPE] [char](1) NOT NULL,
[SEQUENCE] [char](5) NULL,
[COMPANY_CODE] [char](35) NULL,
[COMBO_RULE] [char](4) NULL,
[GL_ACCOUNT_SET] [char](24) NULL,
[GL_ACCOUNT] [char](10) NULL,
[COST_CENTER_SET] [char](24) NULL,
[COST_CENTER] [char](10) NULL,
[WBS_ELEMENT_SET] [char](24) NULL,
[WBS_ELEMENT] [char](24) NULL,
[INTERNAL_ORDER_SET] [char](24) NULL,
[INTERNAL_ORDER] [char](12) NULL,
[KEYCODE_SET] [char](24) NULL,
[KEY_CODE] [char](18) NULL,
[INACTIVE] [char](1) NULL
)
我的查询看起来像这样
BULK INSERT ITFC_COMBO_DATA
FROM 'C:\SFTP\Combo.csv'
WITH
(
FIELDTERMINATOR = '","',
ROWTERMINATOR = '"0x0a',
FIRSTROW = 2
)
我很困惑为什么总是返回
(0 row(s) affected)
我希望数据库中的结果没有双引号(“”)和没有“F”行。因为“F”行只是CSV中的标识符,但“F”不能删除。
帮帮我谢谢。
答案 0 :(得分:2)