【发布时间】:2019-03-24 21:32:09
【问题描述】:
这个问题有点源自另一个帖子How to pass large string_replacement in SQL Replace function,但在这种情况下,大字符位于搜索部分。
例如,
select REPLACE(CAST('CharactersOver10000' AS VARCHAR(MAX), 'CharactersOver8000', 'text' )
上面的select语句会抛出错误
String or binary data would be truncated.
我从Replace documentation 了解到,并怀疑粗体部分可能是问题所在,但不确定这是什么意思以及如何处理超过 8000 个字符的 string_pattern。
字符串模式 是要找到的子字符串。 string_pattern 可以是字符或二进制数据类型。 string_pattern 不能为空字符串 (''),并且不得超过适合页面的最大字节数。
有什么建议吗?
【问题讨论】:
标签: sql sql-server replace