error -4861 - I do a BULK INSERT the contents of a csv file into a table through stored procedure
could you please help me?
I have an application, in which I BULK INSERT the contents of a csv file into a table through stored procedure. The stored Procedure uses BULK INSERT (SQL Server 2005). This works fine in a standalone system. However when I use the same in a multitier 开发者_如何学编程architecture (Web server, Application Server and DB Server) it is throwing 4861 error. Could you please help?
The files are stored on the Web Server.
The translated error message is:
Error – 2147217900:4861:
Since it can not be opened for the file
\\Servername\c$\Folder1\Folder2\Folder3\file.csv,
It can not be loaded with large capacity.
Operation system error code is 5 (error not ……….)
Thanks
Regards, ChandruThat's probably a security issue. If you're running the bulk insert
from a SQL Server job, make sure the user account of the SQL Server Agent service has rights to open the file.
If you're running the query from a regular connection, SQL Server will impersonate you and then try to read the file. However, by default, SQL Server is not allowed to act as someone else. See this answer by Remus Rusanu for more details.
精彩评论