使用BULK INSERT命令将CSV文件导入到SQL Server表中
问题描述:
我有一个CSV文件,其中有几个数据列.
I have CSV file which have a couple of data columns.
CSV文件看起来像
field1:Test1
栏位2:Test2
栏位3:Test3,Test4,Test5
field1: Test1
field2: Test2
field3: Test3, Test4, Test5
在这种情况下,我可以将哪个库用作字段终止符,我的意思是如果我使用此查询将CSV文件插入到shopifyitem
表中,因为您假设数据字段未正确插入
In this case which library can I use as field terminator I mean if I use this query to insert CSV file into shopifyitem
table as you assume that the data field inserted not correctly
BULK INSERT shopifyitem
FROM 'c:\test.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
那我可以使用哪个场终止符?
非常感谢您....
答
尝试使用:ROWTERMINATOR = '0x0a'
Try using:ROWTERMINATOR = '0x0a'