Error trying to execute BULK INSERT in a stored procedure

At my customer's site they get this error trying to run a stored procedure I wrote that does BULK INSERT.

-2147217900

[Microsoft ODBC SQL Server Driver][SQL Server] You do not have permission to use the bulk load statement.

upImportFromICPMSRaw '\\GSADC1\Company\InstrumentOutputFiles\ICPMS\New\185367.csv', tblFromICPMSRaw

The customer has SQL Server 2008 R2 Express installed

The connection string to the database works on everything else and it is the sa account with password

On my own development system with SQL Server 2008 R2 Standard, it works perfectly OK.

Any suggestions gratefully received

Best Regards,

Doug M

May 15th, 2015 11:15pm

1) you have full right on \\GSADC1\Company\InstrumentOutputFiles\ICPMS\New\185367.csv' ?

2) bulkadmin fixed server role can run the BULK INSERT statement

 You should try using format files when your source file doesn't match your target table.

https://msdn.microsoft.com/en-us/library/ms178129.aspx?f=255&MSPPError=-2147217396

Free Windows Admin Tool Kit Click here and download it now
May 15th, 2015 11:37pm

Hi Dinesh,

1. Yes. GSADC1 is the server on which SQL Server resides. The Company folder is shared with everyone having FullControl. The child folder do inherit the sharing. And 185367.csv is NOT read-only

2. On both the customer's server and on mine, the sa account has sysadmin and public roles, but not bulkadmin. But on my system, the stored procedures works fine without bulkadmin being an sa role.

Any other suggestions?

BTW: The source file always comes from a specific Agilent ICP-MS instrument and is automatically generated in the same format every time. My tblFromICPMSRaw matches that format exactly so I didn't think the Format file added value

Best Regards

May 16th, 2015 12:02am

Hi Dinesh,

I did a test. I logged into the customer's server remotely and logged into SSMS with the sa password.

Then I executed the stored procedure with the same parameters I reported in my question above.

The stored procedure worked correctly.

Do you have other suggestions before I proceed to treat it as a network error?

Best Regards,

Free Windows Admin Tool Kit Click here and download it now
May 16th, 2015 12:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics