August 10, 2005 at 9:17 am
Please I need assistant. I have a user that want to do a bulk insert from one server to the database on the SQL Server. On the server level, I have made the user a member of Bulk Insert Administrator and also grant the user select, insert and delete on all the table in the database. The bulk insert is failing. What else do I need to do on the SQL Server and the database side? Thank you guys.
August 10, 2005 at 9:22 am
What are you using to do bulk insert?
what is the error message?
Please post any code or messages that you think may help
August 10, 2005 at 9:31 am
These are the error on the server that is doing the bulk insert.
Server: Msg 4861, Level 16, State 1, Line 2
Could not bulk insert because file '\\PVMX0720\IdentityExporter\Meta\Bulk\Meta.txt' could not be opened. Operating system error code 5(Access is denied.).
Server: Msg 4861, Level 16, State 1, Line 3
Could not bulk insert because file '\\PVMX0720\IdentityExporter\Meta\Bulk\Cid.txt' could not be opened. Operating system error code 5(Access is denied.).
Server: Msg 4861, Level 16, State 1, Line 3
Could not bulk insert because file '\\PVMX0720\IdentityExporter\Emac\Bulk\Emac.fmt' could not be opened. Operating system error code 5(Access is denied.).
Server: Msg 4861, Level 16, State 1, Line 3
Could not bulk insert because file '\\PVMX0720\IdentityExporter\Emac\Bulk\Cid.txt' could not be opened. Operating system error code 5(Access is denied.).
The following are the queries used:
TRUNCATE TABLE MetaIdentitiesStaging
BULK INSERT dbo.MetaIdentitiesStaging
FROM '\\PVMX0720\IdentityExporter\Meta\Bulk\Meta.txt'
WITH (FIELDTERMINATOR = '|', FIRSTROW = 2)
GO
August 10, 2005 at 9:49 am
Check if the server can access that file (ntfs permissions) and that the file path is correct. The server must be logged as a domain login to have access (most likely).
August 11, 2005 at 8:01 am
Which of the server? The SQL server or the sever where the application and file reside?
Thanks.
August 11, 2005 at 8:03 am
Sql server must have access to the server where the file resides to be able to open it.
February 7, 2008 at 4:13 am
Hello,
I have the same problem. Do you have found any solution ?
Thanks in advance.
February 7, 2008 at 6:18 am
Yes... the solution is posted above... the server must be logged into the domain as a user that can actually "see" the file path.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 12, 2008 at 3:02 am
Nice tip...
Sorry about my lack of knowledge but.. How can I grant access the SQL Server to access a folder located in my HD?. I give the sats the UNC format: \\machine\folder\files.txt.
Thanks a lot, mates.
Dvel
February 12, 2008 at 7:25 am
You have to create a "share" to your directory... the share would be for the user that SQL Server logs in as... OR... if SQL Server was given super user or domain admin privs on the Windows Server, you might be able to use the generic C$ administrative share...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 12, 2008 at 11:23 am
I got it; thanks a lot...
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply