Insert image into sql 2005 table

I am trying to insert an image into a table., from this syntax from the web but it does not seem to work for me.  Keeps gving the error of Incorrect syntax near the keyword BULK.  Don't know if my network address will work either.  I am trying to go over netowrk to my computer to get the image.

 SELECT * FROM OPENROWSET(BULK, '\\ngmnnb-j6ops-a2\C:documents and settings\kevin.deutschman\my documents\my pictures\black1.ico', SINGLE_BLOB)
kdeutschAsked:
Who is Participating?
 
pivarConnect With a Mentor Commented:
Hi,

Try this:

SELECT * FROM OPENROWSET(BULK '\\ngmnnb-j6ops-a2\C$\documents and settings\kevin.deutschman\my documents\my pictures\black1.ico', SINGLE_BLOB)

/peter
0
 
DimitrisSenior Solution ArchitectCommented:
remove the ":" from the path
the path is invalid I assume that instead of ":" you should use "\"
0
 
kdeutschAuthor Commented:
Hi Pivar,
Still get the Incorrect syntax near the keyword BULK
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
pivarCommented:
Did you remove the comma after bulk?

Also add an alias
SELECT * FROM OPENROWSET(BULK '\\ngmnnb-j6ops-a2\C$\documents and settings\kevin.deutschman\my documents\my pictures\black1.ico', SINGLE_BLOB) AS icon
0
 
kdeutschAuthor Commented:
Correct, i just copied and pasted from here and checked it agian.
0
 
pivarCommented:
And you still get syntax error? This statement works fine for me.
0
 
kdeutschAuthor Commented:
ah, hold on I am using on my sql 2000 box instead of my sql 2005 box.  I think that makes a differnence
0
 
kdeutschAuthor Commented:
It works, but I got an access denied problem now
0
 
pivarCommented:
Yes, the user you're logged in with must have permission to the file. How do you log in? SQL server or windows authentication?
0
 
kdeutschAuthor Commented:
all windows authentication
0
 
pivarCommented:
So, you must give the windows user permission to your iconfile.
0
 
kdeutschAuthor Commented:
Roger I am just going to stick in on sql server local drive and pick from there. Thanks for help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.