Fruit Quantity Cost
Apple 2 $2
Banana 1 $0.50
Orange 9 $6
以下是我正在使用的代码:
Create Table MyFruit
(
Fruit varchar(50),
Qty Int,
Cost Float
)
BULK INSERT MyFruit
FROM '\\APPFS\user_home$\username\Temp\Fruit.csv'
WITH(
FIRSTROW = 1,
--FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
Select * From MyFruit
我不断发现以下错误:
Msg 4832, Level 16, State 1, Line 9
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 9
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 9
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".