SQLTeam.com | Weblogs | Forums

Error Message With BULK INSERT


#1

Hi All,

I am using SQL SERVER EXPRESS(connected to the AZURE Trial Account Server)

Getting error code as below:

Msg 4861, Level 16, State 1, Line 2
Cannot bulk load because the file "D:\sql\campaigns.txt" could not be opened. Operating system error code (null).

I am using code below:

CREATE TABLE Campaigns (
CampaignId int NOT NULL PRIMARY KEY,
CampaignName varchar(50) NOT NULL,
Channel varchar(50) NOT NULL,
Discount int NOT NULL,
FreeShppingFlag char(1) NOT NULL
) ;

SET @SQL = '
BULK INSERT SQLBook..Campaigns
FROM ''@LOADDIR\campaigns.txt''
WITH (FIRSTROW = 2, FIELDTERMINATOR = '' '')
';

Please help

Regards
Andrey


#2

Here you get solution to fix this error: https://stackoverflow.com/questions/14555262/cannot-bulk-load-operating-system-error-code-5-access-is-denied