-1

I am using SQL server 2012. This is the query I have:

enter image description here

I am getting the following error:

{{Cannot bulk load because the file "C:\Users\chitra\Desktop\j.jpg" could not be opened. Operating system error code 5(Access is denied.).}.

What can I do to remedy this?

TT.
  • 15,774
  • 6
  • 47
  • 88

2 Answers2

3

As the error is trying to tell you, the SQL Server process doesn't have read access to your profile directory.

Either move it to a public directory or grant it access.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
1

This error appears when you are using SQL Server Authentication and SQL Server is not allowed to access the bulk load folder.

So giving SQL server access to the folder will solve the issue.

Here is how to: Go to the folder right click ->properties->Security tab->Edit->Add(on the new window) ->Advanced -> Find Now. Under the users list in the search results, find something like SQLServerMSSQLUser$UserName$SQLExpress and click ok, to all the dialogs opened.

GabrielVa
  • 2,353
  • 9
  • 37
  • 59
  • which folder i used to click – Arvind Kumar Gautam Feb 11 '16 at 19:14
  • The folder where your images are. Giving SQL server access to the folder should solve the issue. If your images are not in a folder, then create one and place the images in there. For example C:\Desktop\MyFolder\Image.jpg – GabrielVa Feb 11 '16 at 19:16