这是我将 CSV 文件批量加载到 SQL Server 2008 中的 SQL,但它返回:
0 row(s) affected.
代码:
USE energyDB
GO
BULK INSERT energydata
FROM 'c:\temp\24544_MSSQL_out.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
CSV 文件如下所示(忽略顶行)
24544,"1970-01-01 10:00:00","8056060 kWh"
24544,"2012-12-04 00:15:00",0.176
24544,"2012-12-04 00:30:00",0.163
24544,"2012-12-04 00:45:00",0.016