Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
EXEC sp_configure 'show advanced options', '1' 
RECONFIGURE 
EXEC sp_configure 'Ad Hoc Distributed Queries', '1' 
RECONFIGURE;

USE master;
GO
CREATE TABLE myTable(FileName nvarchar(60), 
  FileType nvarchar(60), Document varbinary(max));
GO

INSERT INTO myTable(FileName, FileType, Document) 
   SELECT 'Exit.txt' AS FileName, '.txt' AS FileType, * FROM OPENROWSET(BULK N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Exit.txt', SINGLE_BLOB) AS Document;
GO


error is-
Msg 4861, Level 16, State 1, Line 2
Cannot bulk load because the file "E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Exit.txt" could not be opened. Operating system error code 3(failed to retrieve text for this error. Reason: 15105).
Posted
Updated 12-Jun-12 1:20am
v3

1 solution

"error code 3" is ERROR_PATH_NOT_FOUND: the file does not exist!
 
Share this answer
 
Comments
suzeets 21-Jun-12 6:54am    
i know that error code 3 . but why this error occurs while that file exist in specified path .
a.g.s.maxwell 19-Jul-12 10:51am    
I have the same problem in an SSIS package when using the Bulk Insert Task Editor to import data from a text file to a SQL Server table. The txt file exists, is local, is readable and writable and I am still getting this error.

Anyone have any ideas??
Bernhard Hiller 20-Jul-12 3:48am    
Readable and writable: by whom? That's the point! SQL Server does normally not run with your user account, but with a SYSTEM account. And that user must have the right to read/write that file.
a.g.s.maxwell 20-Jul-12 3:57am    
I realised that in my situation, the Bulk Insert Task will be calling the insert command from the server that the DB is on, not from the server running the SSIS package. The file only existed on the package server, not the DB server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900