| Author |
Topic |
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-17 : 10:07:18
|
| hiii,i would like to know how to insert an image field from one table to another in sql 2000 exinsert into fax_doc1(docno,dms_docdata) values (select docno, dms_docdata from fax_doc2 where dms_docno='631')where docdata columns are binary datatypes |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-17 : 11:19:57
|
| [code]insert into fax_doc1(docno,dms_docdata) select docno, dms_docdata from fax_doc2 where dms_docno='631'[/code] |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-18 : 00:27:31
|
| Thankssssssssssss u r z saving angel :D |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 00:55:49
|
Cheers |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-18 : 09:11:28
|
| ok this how to insert but the update fails y !!!update fax_doc setdms_docdata = (select dms_docdata from fax_doc where dms_docno='631')where dms_docno='686'The text, ntext, and image data types are invalid in this subquery or aggregate expression.how to fix thanks again |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 09:14:05
|
| whats the datatype of dms_docdata? |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-18 : 09:34:55
|
| image same i inserted to the image but now i want to update the replace the content with another already inserted record |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 10:40:12
|
| use UPDATETEXT function found belowhttp://www.sqlservercentral.com/articles/Miscellaneous/handlingthetextdatatype/985/ |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-19 : 03:38:07
|
| sorry may be i was not clear in the previous comment but what i have to do is to replace the whole image field with a new image field already exist in another column i.e. not to modify the content of the field |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-19 : 03:45:00
|
quote: Originally posted by ann06 sorry may be i was not clear in the previous comment but what i have to do is to replace the whole image field with a new image field already exist in another column i.e. not to modify the content of the field
i know that. but you need to get start pointer of text using TEXTPTR and then use UPDATETEXT as explained in article |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-19 : 03:52:43
|
Try thisupdate fdset fd.dms_docdata = w.dms_docdataFROM fax_doc AS fdinner join fax_doc AS w on w.dms_docno = '631'where fd.dms_docno = '686' E 12°55'05.63"N 56°04'39.26" |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-19 : 05:40:08
|
| ewwww it worked :Dthanks guys mr. Visakh and mr. Peso |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-19 : 06:04:21
|
I hope you get that UPDATETEXT out of your head... E 12°55'05.63"N 56°04'39.26" |
 |
|
|
ann06
Posting Yak Master
171 Posts |
Posted - 2008-11-19 : 09:06:41
|
| saved it for another kind of crisis :D |
 |
|
|
|