update article set article_content=REPLACE(Cast(article_content as varchar(max)),'?',' ') where article_id=191

 

原报错代码:

1
update tablename set colname=replace(colname,'oldtext','newtext'); 
修改后可执行代码:

1
update tablename set colname=replace(Cast(colname as varchar(8000)),'oldtext','newtext');
1
update tablename set colname=replace(Cast(colname as nvarchar(4000)),'oldtext','newtext');
附:max类型的介绍
varchar(max)、nvarchar(max) 和 varbinary(max) 统称为大值数据类型。可以使用大值数据类型来存储最大为 2^31-1 个字节的数据。
max 说明符是在Microsoft SQL Server 2005 中引入的。此说明符增强了 varchar、nvarchar 和 varbinary 数据类型的存储能力。

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
猜你喜欢
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
相关资源
相似解决方案