Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Problem in using Bulk Insert

Author  Topic 

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-03 : 05:59:05
Hi,

I have created a login using windows authentication in sql server 2005. I have given it sysadmin server role. When I'm trying to run BULK INSERT through this login, it gives me an error:

"Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "Z:\Folder1\file1.dat" could not be opened. Operating system error code 3(The system cannot find the path specified.)."

Using UNC it gives me this error:

"Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\Server1\MainFolder\Folder1\file1.dat" could not be opened. Operating system error code 5(Access is denied.)."

BCP is running fine though.

BULK INSERT is running fine using the sa login. Could you please help me out here in solving this problem.

Thanks,
RM

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-03 : 06:08:02
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1140586&SiteID=17
Go to Top of Page

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-03 : 06:30:57
Thanks for your reply visakh16, but this did not work. Settings for remote connections was already "using TCP/IP only". I also tried changing it to "Using both TCP/IP and named pipes" but it did not work.
Go to Top of Page

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-03 : 07:27:30
When I'm adding a user in SQL Server 2005 who is a part of windows admin, BULK INSERT works well for that user but not for other users. Is it necessary for a login to be a part of admin for getting BULK INSERT run?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-03 : 08:27:39
quote:
Originally posted by RM

When I'm adding a user in SQL Server 2005 who is a part of windows admin, BULK INSERT works well for that user but not for other users. Is it necessary for a login to be a part of admin for getting BULK INSERT run?



Yes sir. You have to have Bulk admin.
Go to Top of Page

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-03 : 08:32:39
Hi Sodeep, I was talking about the windows admin role. As I said I have already granted sysadmin role to the user but it is not working.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-03 : 08:37:46
But the error shows it can't open the file.
Go to Top of Page

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-03 : 09:11:40
Yes that is where the problem is ... !! BULK INSERT is working well with sa login as well as anyother sql server authenticated login with sysadmin server role. It is also working with the windows authenticated logins for the windows users with admin level of rights.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-03 : 13:07:24
Logins should have access to that folder as well. It doesn't require sysadmin just to bulk insert.
Go to Top of Page

RM
Yak Posting Veteran

65 Posts

Posted - 2008-07-04 : 02:10:34
The logins have read/write access to that folder.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-04 : 20:12:23
Ensure sql service account has permission to access that file.
Go to Top of Page
   

- Advertisement -