• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

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)
0
kdeutsch
Asked:
kdeutsch
  • 6
  • 5
1 Solution
 
pivarCommented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
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

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now