基本方法: UPDATETEXT { table_name.dest_column_name dest_text_ptr }//{ 要更新的表以及 text、ntext 或 image 列的名稱, 指向要更新的 text、ntext 或 image 資料的文本指針的值(由 TEXTPTR 函數傳回)。dest_text_ptr 必須為資料類型 binary(16)。 } { NULL | insert_offset } { NULL | delete_length } [ WITH LOG ] [ inserted_data | { table_name.src_column_name src_text_ptr } ] 新插入的資料可以是單個 inserted_data 常量、表名、列名或文本指針。 Update 操作 UPDATETEXT 參數 替換現有資料 指定一個非空 insert_offset 值、非零 delete_length 值和要插入的新資料。 删除現有資料 指定一個非空 insert_offset 值、非零 delete_length 值和要插入的新資料。不指定要插入的新資料。 插入新資料 指定 insert_offset 值、為 0 的 delete_length 值和要插入的新資料。 為獲得最佳性能,建議在插入或更新 text、ntext 和 image 資料時,使用 8,040 位元組的倍數的塊區大小。 insert_offset 以零為基的更新起始位置。對于 text 或 image 列, insert_offset 是在插入新資料前要從現有列的起點跳過的位元組數。對于 ntext 列, insert_offset 是字元數(每個 ntext 字元占用 2 個位元組)。從此基數為零的起始點開始的現有 text、ntext 或 image 資料向右移,為新資料留出空間。值為 0 表示将新資料插入現有資料的開始處。 值為 NULL 則将新資料追加到現有資料值後。 delete_length 從 insert_offset 位置開始的、要從現有 text、ntext 或 image 列中删除的資料長度。 delete_length 值對于 text 和 image 列用位元組指定,對于 ntext 列用字元指定。每個 ntext 字元占用 2 個位元組。值為 0 表示不删除資料。值為 NULL 則删除現有 text 或 image 列中從 insert_offset 位置開始到末尾的所有資料。 WITH LOG 在 SQL Server 2000 中被忽略。在 SQL Server 2005 中,日志記錄由資料庫的實際恢複模型決定。 inserted_data 要插入現有 text、ntext 或 image 列的 insert_offset 位置的資料。這是單個 char、nchar、varchar、nvarchar、binary、varbinary、text、ntext 或 image 值。inserted_data 可以是文字或變量。 table_name.src_column_name 用作插入資料源的表或 text、ntext 或 image 列的名稱。表名和列名必須符合辨別符規則。 src_text_ptr 指向用作插入資料源的 text、ntext 或 image 列的文本指針值(由 TEXTPTR 函數傳回)。 eg. declare @ptrval binary(16) select @ptrval=textptr(operlog) from order_flight where id=12475 updatetext order_flight.operlog @ptrval null 0 '11'