sql server 更新记录 在原本的记录内容前追加文本

2025-06-20 18:33:07
推荐回答(3个)
回答1:

update test set field= '字符串文本' + field where id=1;

先把field字段text改为varchar(5000) ,然后再执行语句, 执行完后改回text类型, 因为SQL Server不支持text类型与varchar的运算符.

回答2:

update test set field=field+'这里怎么写 加上原有的内容呢?' where id=1

回答3:

update test set field=field+‘新加内容’ where id=1