February 25, 2015 at 11:55 pm
Hi,
I want to store Images as binary data in SQL table and compare it each time with a image file I am getting.
I've tried below approach but getting error:
DROP TABLE #BLOBTest
CREATE TABLE #BLOBTest
(
TestID int IDENTITY(1,1),
BLOBName varChar(50),
BLOBData varBinary(MAX)
);
INSERT INTO #BLOBTest
(BLOBName, BLOBData)
SELECT 'First test file',
BulkColumn FROM OPENROWSET(
Bulk 'C:\Files\12656.jpg', SINGLE_BLOB) AS BLOB
Error: Msg 4861, Level 16, State 1, Line 10
Cannot bulk load because the file "C:\Files\12656.jpg" could not be opened. Operating system error code 3(failed to retrieve text for this error. Reason: 15105).
Please help.
____________________________________________________________
APFebruary 26, 2015 at 12:39 am
The error 3 indicates a lack of ntfs permissions on the file location.
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
February 26, 2015 at 2:35 am
I have given all permissions, still same issue.
Is there any other way we can store images as binary in SQL table?
____________________________________________________________
APFebruary 26, 2015 at 6:49 am
Anshul Parmar (2/26/2015)
I have given all permissions, still same issue.
Full permission to who??
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
February 26, 2015 at 6:55 am
the file must exist on the server, unless you explicitly call a unc path like \\servername\c$\Files\12656.jpg
even then, the service account that SQL runs under must be the one with permissions to wherever the file exists...not YOU.
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply