我试图在SQL中使用以下语句将数据从csv插入到SQL ..
CREATE TABLE Test
(A bigint,
B smallint,
C real,
D real,
E real,
F real,
G real,
H real,
I real,
J real,
K real,
L real,
M real,
N real,
O real,
P real,
Q varchar(MAX),
R varchar(MAX))
BULK INSERT Test
FROM 'C:\DataFiles\Tests.csv'
WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n', FIRSTROW = 2 )
我的数据如下:
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R"
"900010000000257","46","580.29","1912.31","237.73","841.41",,,"253.35","995.30","225.38","2808.70","1536.87","2250.60","1628.19","111.91",,
"900010000000425","46","1580.29","1912.31","252.34","2557.97",,,"1256.35","195.30","225.38","208.70","1534.50","222.80","1628.19","284.23",,
"900010000000841","21","489.26","5462.95","6419.69","7353.56",,,"467.70","535.01","597.93","530.84","5243.47","589.86","5790.72","6794.30",,
"900010000000990","19","4880.14","5609.45","6586.67","7470.17",,,"480.14","523.12","558.16","655.44","504.21","609.54","639.31","735.34",,
我收到消息0行没有错误..请帮助。
答案 0 :(得分:0)
尝试提供完整的指定路径,例如C:\path.csv
答案 1 :(得分:-1)
我认为你不应该在数据文件中有列名。