0
votes

i have tried import file csv using bulk insert but it is failed, is there another way in query to import csv file without using bulk insert ? so far this is my query but it use bulk insert :

bulk insert [dbo].[TEMP] from

'C:\Inetpub\vhosts\topimerah.org\httpdocs\SNASPV0374280960.txt' with (firstrow=2,fieldterminator = '~', rowterminator = ' ');

1
share the error message please.Greg
i have arranged the access bulk admin , but when i execute that query . the error is : Msg 4861, Level 16, State 1, Line 1 Cannot bulk load because the file "D:\SNASPV031874361060.txt" could not be opened. Operating system error code 21(The device is not ready.).Galih Leo
Error code 21 means something is wrong with the file or disk. Check the event log to ensure there are no other issues. Another way to validate is to try it using bcp.exe.Greg

1 Answers

0
votes

My answer is to work with bulk-insert. 1. Make sure you have bulk-admin permission in server. 2. Use SQL authentication login (For me most of the time window authentication login haven't worked.) for bulk-insert operation.