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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 problem while inserting image

Author  Topic 

mayoorsubbu
Yak Posting Veteran

95 Posts

Posted - 2011-12-30 : 22:32:18
Hi everyone,
I have a table with a image datatype column in sql 2005. while i try to insert an image, get an error

update requestdetails set letterimage =
(select * FROM OPENROWSET(BULK 'C:\xyz.JPG', SINGLE_BLOB) AS img)

error
Cannot bulk load because the file "C:\xyz.JPG" could not be opened. Operating system error code 5(error not found


The jpg image does exist and the path is correct. What is it that I am doing wrong.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-12-30 : 22:41:14
Does it exist on the database server? The path needs to be in the database server's perspective and not your client machine's.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mayoorsubbu
Yak Posting Veteran

95 Posts

Posted - 2011-12-30 : 22:52:11
Hi tkizer,

The image does exist on the machine as the database server
Thanks
Go to Top of Page
   

- Advertisement -