|
-
Feb 3rd, 2010, 06:39 AM
#1
Thread Starter
Frenzied Member
Inserting image in Table using SQL Server 2005
I have a table named Nomogram.
I wich to insert an image named td4.png into the column "img1" in the table Nomogram. Why does it not work?
img1 is defined as varbinary(MAX).
When I fire this event in the SQL Manager I get an error:
Code:
UPDATE Nomogram
SET img1 =
(SELECT *
FROM OPENROWSET(BULK 'C:\td4.png', SINGLE_BLOB) AS ResumeContent)
WHERE (bId = 133)
Does any have a clue?
-
Feb 3rd, 2010, 10:49 AM
#2
Re: Inserting image in Table using SQL Server 2005
The syntax of Update statement is valid and works fine for me.
What error are you getting? Possible causes
Using 'C:\td4.png'. That file must exist on the computer running SQL Server, not the computer where the statement is executed.
Permissions.
-
Feb 4th, 2010, 03:19 AM
#3
Thread Starter
Frenzied Member
Re: Inserting image in Table using SQL Server 2005
That could be it!
It says: You do have have permission to use the bulk load statement.
My files are located at the SQL Server where I fire the event in a folder named Images (path is Images\td4.png)
How do I write the command then?
Like this?
Code:
UPDATE Nomogram
SET img1 =
(SELECT *
FROM OPENROWSET(BULK N'td4.png', SINGLE_BLOB) AS ORS)
WHERE (bId = 133)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|