Discussion:
Cannot bulk load because the file
(too old to reply)
SreeV
2009-10-08 21:49:01 UTC
Permalink
I am getting error when i tried bulk insert into SQL Server 2008 it works
fine on SQL Server but it fails from my desktop. I am using windows
authentication have access to the share fine.

version:SQL Server 2008 version
OS: windows 2008

BULK INSERT table
FROM '\\computrname\Project Avast\Bulk Insert\TEST.LOG'
WITH (DATAFILETYPE = 'char', FIELDTERMINATOR = ',')


sg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\computer\TEST.txt" could not be opened.
Operating system error code 5(Access is denied.).

tried disabling named pipes didnt help.
Jeroen Mostert
2009-10-08 22:05:38 UTC
Permalink
Post by SreeV
I am getting error when i tried bulk insert into SQL Server 2008 it works
fine on SQL Server but it fails from my desktop. I am using windows
authentication have access to the share fine.
version:SQL Server 2008 version
OS: windows 2008
BULK INSERT table
FROM '\\computrname\Project Avast\Bulk Insert\TEST.LOG'
WITH (DATAFILETYPE = 'char', FIELDTERMINATOR = ',')
sg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\computer\TEST.txt" could not be opened.
That's not remotely the same name. I'm assuming you're making this stuff up,
badly, otherwise your network has serious problems.
Post by SreeV
Operating system error code 5(Access is denied.).
Verify that the account that SQL Server runs under can access the file,
because this message is telling you it can't. That you can read the file
(from any location) is not a test, neither is putting the file on the server
itself.

If SQL Server is running under "local service" credentials, it will not be
able to access any remote share as it will use anonymous credentials. When
running as "network service", it will use the machine account
(COMPUTERNAME$) for accessing shares. Running SQL Server under a specific
domain account prevents surprises and allows you to fine-tune permissions
(changing the account post-install is a pain, though; it pays off to get
this right the first time).
--
J.
SreeV
2009-10-09 17:18:01 UTC
Permalink
SQL Server is running under domain account not under "local service" the file
is accesable from the host and the SQL Server the same script I was able to
run on SQL Server 2000 but not on SQL Server 2008.

I found some posting on net some other people are having same issue.. didnt
solve our problem by disabling Named pipes protocol.

http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/7b87d35f-7b08-4727-9544-8dd7035c5e87

Thanks,
Sree
Post by Jeroen Mostert
Post by SreeV
I am getting error when i tried bulk insert into SQL Server 2008 it works
fine on SQL Server but it fails from my desktop. I am using windows
authentication have access to the share fine.
version:SQL Server 2008 version
OS: windows 2008
BULK INSERT table
FROM '\\computrname\Project Avast\Bulk Insert\TEST.LOG'
WITH (DATAFILETYPE = 'char', FIELDTERMINATOR = ',')
sg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\\computer\TEST.txt" could not be opened.
That's not remotely the same name. I'm assuming you're making this stuff up,
badly, otherwise your network has serious problems.
Post by SreeV
Operating system error code 5(Access is denied.).
Verify that the account that SQL Server runs under can access the file,
because this message is telling you it can't. That you can read the file
(from any location) is not a test, neither is putting the file on the server
itself.
If SQL Server is running under "local service" credentials, it will not be
able to access any remote share as it will use anonymous credentials. When
running as "network service", it will use the machine account
(COMPUTERNAME$) for accessing shares. Running SQL Server under a specific
domain account prevents surprises and allows you to fine-tune permissions
(changing the account post-install is a pain, though; it pays off to get
this right the first time).
--
J.
Erland Sommarskog
2009-10-09 21:52:04 UTC
Permalink
Post by SreeV
SQL Server is running under domain account not under "local service" the
file is accesable from the host and the SQL Server the same script I was
able to run on SQL Server 2000 but not on SQL Server 2008.
Change the service account to be domain account that has access to
the path where the file is. Local Service is not a good choice for
the service account.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Jeroen Mostert
2009-10-10 08:41:24 UTC
Permalink
Post by Erland Sommarskog
Post by SreeV
SQL Server is running under domain account not under "local service" the
file is accesable from the host and the SQL Server the same script I was
able to run on SQL Server 2000 but not on SQL Server 2008.
Change the service account to be domain account that has access to
the path where the file is. Local Service is not a good choice for
the service account.
The OP in fact said he's running the server under a domain account.
--
J.
Erland Sommarskog
2009-10-10 08:48:12 UTC
Permalink
Post by Jeroen Mostert
Post by Erland Sommarskog
Post by SreeV
SQL Server is running under domain account not under "local service" the
file is accesable from the host and the SQL Server the same script I was
able to run on SQL Server 2000 but not on SQL Server 2008.
Change the service account to be domain account that has access to
the path where the file is. Local Service is not a good choice for
the service account.
The OP in fact said he's running the server under a domain account.
Oops, I need to learn to read better.

But there may be reason to check out the permissions for the service
account.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Jeroen Mostert
2009-10-10 08:43:31 UTC
Permalink
Post by SreeV
SQL Server is running under domain account not under "local service" the file
is accesable from the host and the SQL Server the same script I was able to
run on SQL Server 2000 but not on SQL Server 2008.
I assume you (or someone else) knows the password to the account. Log in on
the SQL Server machine with those credentials and try accessing the file
from a command prompt ("type \\remotemachine\dir\file"). If this gives you
"Access denied", you know the problem is in the credentials (the account may
have permission but authenticating remotely can still fail). If this
succeeds, on the other hand, you know the problem is with SQL Server. This
does not directly solve anything but does allow you to direct further
troubleshooting.
--
J.
Newbie
2009-12-01 20:23:02 UTC
Permalink
I have the same issue. A procedure to bulk loading XML file into a field and
runs fine under sa but not under any other account. The other account and
the account the sql service is running under are all domain admin account.
I've even tried opening up the shared directory on the other server to
everyone, anonymous and my next door neighbor. Tried running the proc as sa
but that opens up a whole other can of worms. I can open the file from the
sql server using my credential so that's ok. What does credential does SQL
Server pass along when it bulk load??
Post by Jeroen Mostert
Post by SreeV
SQL Server is running under domain account not under "local service" the file
is accesable from the host and the SQL Server the same script I was able to
run on SQL Server 2000 but not on SQL Server 2008.
I assume you (or someone else) knows the password to the account. Log in on
the SQL Server machine with those credentials and try accessing the file
from a command prompt ("type \\remotemachine\dir\file"). If this gives you
"Access denied", you know the problem is in the credentials (the account may
have permission but authenticating remotely can still fail). If this
succeeds, on the other hand, you know the problem is with SQL Server. This
does not directly solve anything but does allow you to direct further
troubleshooting.
--
J.
Steve
2009-12-03 18:33:01 UTC
Permalink
Encountering the same problem. I have narrowed the problem down to trusted
logins. I can process correctly with a SQL Server authentication login.
Need to figure out the security context for a trusted login.

Steve
Post by Newbie
I have the same issue. A procedure to bulk loading XML file into a field and
runs fine under sa but not under any other account. The other account and
the account the sql service is running under are all domain admin account.
I've even tried opening up the shared directory on the other server to
everyone, anonymous and my next door neighbor. Tried running the proc as sa
but that opens up a whole other can of worms. I can open the file from the
sql server using my credential so that's ok. What does credential does SQL
Server pass along when it bulk load??
Post by Jeroen Mostert
Post by SreeV
SQL Server is running under domain account not under "local service" the file
is accesable from the host and the SQL Server the same script I was able to
run on SQL Server 2000 but not on SQL Server 2008.
I assume you (or someone else) knows the password to the account. Log in on
the SQL Server machine with those credentials and try accessing the file
from a command prompt ("type \\remotemachine\dir\file"). If this gives you
"Access denied", you know the problem is in the credentials (the account may
have permission but authenticating remotely can still fail). If this
succeeds, on the other hand, you know the problem is with SQL Server. This
does not directly solve anything but does allow you to direct further
troubleshooting.
--
J.
Continue reading on narkive:
Loading...