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.
| Author |
Topic |
|
scholin
Yak Posting Veteran
56 Posts |
Posted - 2010-02-01 : 18:02:40
|
| I am relatively new to sql and in the past I could simply copy and paste a small jpeg picture into a field (old database -not sql). I am using SQL 2008 with management studio. I need to upload just few signatures that are jpeg into an image field - varbinary(MAX).Some how I did it once a couple of months ago but can't recall how I did it!So how would I copy a small jpeg signature into "dbo.reader" column "signature"?I have searched the net and found a few sophisticate solutions (that I don't understand) but I just need to do a couple of signatures for right now.Thanks! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-02 : 04:05:23
|
| http://weblogs.sqlteam.com/peterl/archive/2007/09/26/Insert-binary-data-like-images-into-SQL-Server-without-front-end.aspx |
 |
|
|
scholin
Yak Posting Veteran
56 Posts |
Posted - 2010-02-02 : 08:11:59
|
| Visakh,This works . . . kind of. I can create a new row (insert) with just that field if I use the following:(had to add the rs for some reason??)insert reader(Signature) SELECT * FROM OPENROWSET(BULK N'C:\Signatures\WC VanNess MD.jpg', SINGLE_BLOB) rsBut when I try to change it to an UPDATE:update reader(Signature) SELECT * FROM OPENROWSET(BULK N'C:\Signatures\WC VanNess MD.jpg', SINGLE_BLOB) rsWhere reader_ID=110 I get a syntax error "near '(' "I have played around with differnt configurations but no luck updating a specific field.What am I missing . . . I am sure it is something dumb on my part.Thanks! |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-02-02 : 08:31:39
|
update-syntax!update tableset column=... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
scholin
Yak Posting Veteran
56 Posts |
Posted - 2010-02-02 : 08:56:37
|
LOL - it must be frustrating dealing with newbies every day! This was stupid on my part. Although the OPENROWSET really did throw me and I was unable to find a whole lot of meaningful help online - but I did get it figured out. Here is the solution that is working for me now:update readerset Signature= (SELECT *FROM OPENROWSET(BULK N'C:\Signatures\WC VanNess MD.jpg', SINGLE_BLOB) AS x )Where reader_ID=110 Thanks again Webfred and visakh - your help is greatly appreciated by many! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-02 : 09:24:16
|
welcome |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-02-02 : 09:24:35
|
Not frustrating You're always welcome! No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|