February 17, 2016 at 5:41 am
I used code below to insert txt file to a table from local drive but got an error said
Cannot bulk load because the file "d:\order.TXT" could not be opened
BULK INSERT #tableOrder
FROM 'd:\order.TXT'
If I change to url it works.
BULK INSERT #tableOrder
FROM '\\order\order.TXT'
How to fix it to load txt data from local drive?
February 17, 2016 at 6:06 am
Hi,
the account who started the sql-server / sql-server-agent, has this account rights to the file/folder, or only to the share?
Kind regards,
Andreas
February 17, 2016 at 6:13 am
This admin account (sa)
February 17, 2016 at 11:47 am
adonetok (2/17/2016)
I used code below to insert txt file to a table from local drive but got an error saidCannot bulk load because the file "d:\order.TXT" could not be opened
BULK INSERT #tableOrder
FROM 'd:\order.TXT'
If I change to url it works.
BULK INSERT #tableOrder
FROM '\\order\order.TXT'
How to fix it to load txt data from local drive?
Is that file on the D: drive on the server?
If it's on your own workstation, then SQL Server will definitely not see it. SQL Server does not run on your workstation, it runs on its own server.
Also check that the service account used to run the SQL Server service (which you can find in the configuration tool) has permissions to read the file.
February 17, 2016 at 11:55 am
D is in local drive.
Your answer help me.
Thank you.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply