update TXET字段 并在字段后面增加字符‘aa’的如何写

jxwa_wzw 2008-08-20 05:39:48
表tablea有一个字段 dd 类型text
update tablea set dd=dd+'aa' 执行会失败?请问应该如何写?
...全文
98 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
中国风 2008-08-21
  • 打赏
  • 举报
回复
declare cur cursor for 
select textptr(Col) from T
declare @p binary(16)
open cur
fetch next from cur into @p
while @@fetch_status=0
begin
updatetext T.Col @p null null N'aa'
fetch next from cur into @p
end
close cur
deallocate cur
zoujp_xyz 2008-08-21
  • 打赏
  • 举报
回复

结合使用:可以看看联机丛书的说明
textvalid()
textptr()
updatetext()
linux_ch 2008-08-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 sdhylj 的回复:]
SQL codeupdate tablea
set dd=cast(cast(dd as varchar)+'aa' as text)
[/Quote]
中国风 2008-08-20
  • 打赏
  • 举报
回复
用游標執行UPDATETEXT命令更新
字符少於8000時,可用
cast(col as varchar(8000))+'aa'
青锋-SS 2008-08-20
  • 打赏
  • 举报
回复
update tablea
set dd=cast(cast(dd as varchar)+'aa' as text)
青锋-SS 2008-08-20
  • 打赏
  • 举报
回复
update tablea
set dd=cast(dd as varchar)+'aa' as text)

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧