--text字段增加处理

--创建测试表
create table test(id varchar(3),detail text)
insert into test
select '001','A*B'

--定义添加的的字符串
declare @s_str varchar(8000),@postion int
select @s_str='*C' --要添加的字符串
,@postion=null--追加的位置,null 加在尾部,0 加在首部,其他值则加在指定位置

--字符串添加处理
declare @p varbinary(16)
select @p=textptr(detail) from test where id='001'
updatetext test.detail @p @postion 0 @s_str

--显示处理结果
select * from test
go

--删除测试表
drop table test

 

相关文章:

  • 2021-07-12
  • 2021-06-28
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案