如题,谢谢

解决方案 »

  1.   

    UPDATETEXT
    更新现有 text、ntext 或 image 字段。使用 UPDATETEXT 在适当的位置更改 text、ntext 或 image 列的一部分。使用 WRITETEXT 来更新和替换整个 text、ntext 或 image 字段。语法
    UPDATETEXT { table_name.dest_column_name dest_text_ptr } 
        { NULL | insert_offset }
        { NULL | delete_length }
        [ WITH LOG ]
        [ inserted_data
            | { table_name.src_column_name src_text_ptr } ]
      

  2.   

    DECLARE @ptrval binary(16)
    SELECT @ptrval = TEXTPTR(pr_info) 
       FROM pub_info pr, publishers p
          WHERE p.pub_id = pr.pub_id 
          AND p.pub_name = 'New Moon Books'
    UPDATETEXT pub_info.pr_info @ptrval 88 1 'b' 
    GO
      

  3.   


    修改text类型字段的值:
    create table os(SoftIntro text,ID int) 
    insert into os 
    select  'aaa',1004 
    union all 
    select  'bbb',1003 
    union all 
    select  'ccc',1002 
    declare @ptr binary(16) 
    select @ptr=textptr(SoftIntro) from os where id=1002 
    updatetext os.SoftIntro @ptr null 0  'dddd'
    select * from os