I've run into a strange situation that seems to involve long text overflowing. I'm using fn_pcre_replace
(from the xp_pcre extended stored procedure) on an nvarchar(max)
column, and when I replace with more characters than were there originally, it returns NULL if the original string was over 8000 characters long.
For example, this
Select master.dbo.fn_pcre_replace(Overview,'a', 'X')
from ProjectContent
works as expected, but this
Select master.dbo.fn_pcre_replace(Overview,'a', 'XXX')
from ProjectContent
returns NULL in most cases (apparently, wherever Len(Overview)>8000
).
Is this a limitation of xp_pcre
, or is there something I can do in my SQL to make this work?