Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
HIiam using sqlserver 2008.when iam trying to upload the image file intable it shows the below error:
INSERT INTO DBFiles(fname, [file])SELECT 'logitech.jpg', * FROM OPENROWSET( BULK N'D:\images\logitech.jpg', SINGLE_BLOB) rs;
error:Cannot bulk load because the file "D:\images\logitech.jpg" could not be opened. Operating system error code 5(failed to retrieve text for this error. Reason: 15105).
Lumbago
Norsk Yak Master
3271 Posts
Posted - 2010-11-30 : 08:03:16
Are you sure that the image is visible to the sql server in the location you are providing? For sql server to be able to load the file in to a table, the folder you have specified needs to be on the database server and the user running the sql server service account must have read access to this file.- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com
sent_sara
Constraint Violating Yak Guru
377 Posts
Posted - 2010-12-01 : 09:12:17
image is visible in the location and more over iam using sa account only..how to check user running the sql server service account must have read access to this file
quote:Originally posted by Lumbago Are you sure that the image is visible to the sql server in the location you are providing? For sql server to be able to load the file in to a table, the folder you have specified needs to be on the database server and the user running the sql server service account must have read access to this file.- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com
sent_sara
Constraint Violating Yak Guru
377 Posts
Posted - 2010-12-01 : 12:06:36
quote:Originally posted by sent_sara HIiam using sqlserver 2008.when iam trying to upload the image file intable it shows the below error:
INSERT INTO DBFiles(fname, [file])SELECT 'logitech.jpg', * FROM OPENROWSET( BULK N'D:\images\logitech.jpg', SINGLE_BLOB) rs;
error:Cannot bulk load because the file "D:\images\logitech.jpg" could not be opened. Operating system error code 5(failed to retrieve text for this error. Reason: 15105).
webfred
Master Smack Fu Yak Hacker
8781 Posts
Posted - 2010-12-01 : 12:18:54
Is D:\images located on the server machine or is it a folder on your client machine?SQL Server can't access your client hard-drives.No, you're never too old to Yak'n'Roll if you're too young to die.
sent_sara
Constraint Violating Yak Guru
377 Posts
Posted - 2010-12-01 : 23:32:35
its is in server machine only
quote:Originally posted by webfred Is D:\images located on the server machine or is it a folder on your client machine?SQL Server can't access your client hard-drives.No, you're never too old to Yak'n'Roll if you're too young to die.
Sachin.Nand
2937 Posts
Posted - 2010-12-02 : 00:11:20
Right Click the Images folder>>Properties>>Security>> and the Add "EveryOne" and give all the Access to that folder and then try.PBUH
Kristen
Test
22859 Posts
Posted - 2010-12-02 : 03:07:19
If SQL is configured to allow running xp_cmdshell tryEXEC master.dbo.xp_cmdshell 'DIR D:\images\logitech.jpg'to see if the file is "visible" to SQL Server, and at that location.