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 |
|
wombel
Starting Member
14 Posts |
Posted - 2002-07-22 : 11:31:18
|
| Hi,I need to move image date (datatype image) from one table to another in a stored procedure, but it just won't work.Can anyone help me with that?TIAThomas WrobelSenior IT Manager |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-22 : 14:18:52
|
How about you post what you are trying and the error message you are getting....This works for me....create table imagetest (img image)create table imagetest2 (img image)insert into imagetest values ('blah')insert imagetest2(img)select img from imagetest<O> |
 |
|
|
wombel
Starting Member
14 Posts |
Posted - 2002-07-23 : 04:49:34
|
Well, I guess I should have been more precise ;-)I tried to update a table with an image field with one from another table.I uses the following statements:update blobtest set pic = select pic from member_galerie_picswhere id = 42But all I got was: Server: Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'select'.quote: How about you post what you are trying and the error message you are getting....This works for me....create table imagetest (img image)create table imagetest2 (img image)insert into imagetest values ('blah')insert imagetest2(img)select img from imagetest<O>
Thomas WrobelSenior IT Manager |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2002-07-23 : 05:01:09
|
| ummm yeah.... The syntax is invalid.....try something like this....update blobtest set pic = (select pic from member_galerie_pics where id = 42)where id = 42PeaceRick |
 |
|
|
wombel
Starting Member
14 Posts |
Posted - 2002-07-23 : 05:08:07
|
| I tried that, too.I used:update blobtest set pic = (select pic from member_galerie_picswhere id = 42)where id = 1But in return I got this:Server: Msg 279, Level 16, State 3, Line 1The text, ntext, and image data types are invalid in this subquery or aggregate expression.Thomas WrobelSenior IT Manager |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-23 : 08:09:03
|
| UPDATE b SET pic = m.picFROM blobtest B INNER JOIN member_galerie_pics MON B.id=M.idWHERE B.id = 42Haven't tested it but it should work. If not, you'll have to look at cursors (eeeeeeeeeeeeeeewwwwwwwwwwwwwwwww) in conjunction with READTEXT and UPDATETEXT. |
 |
|
|
wombel
Starting Member
14 Posts |
Posted - 2002-07-23 : 08:48:27
|
Thanks!!!quote: UPDATE b SET pic = m.picFROM blobtest B INNER JOIN member_galerie_pics MON B.id=M.idWHERE B.id = 42Haven't tested it but it should work. If not, you'll have to look at cursors (eeeeeeeeeeeeeeewwwwwwwwwwwwwwwww) in conjunction with READTEXT and UPDATETEXT.
Thomas WrobelSenior IT Manager |
 |
|
|
|
|
|
|
|