Determine whether the default collation is case-sensitive like this:
select charindex('RESULT', 'If the result is 0 you are in a case-sensitive collation mode')
A result of 0 indicates you are in a case-sensitive collation mode, 8 indicates it is case-insensitive.
If the collation is case-insensitive, you need to explicitly declare the collation mode you want to use when performing a search/replace.
Here's how to construct an UPDATE statement to perform a case-sensitive search/replace by specifying the collation mode to use:
update ContentTable
set ContentValue = replace(ContentValue COLLATE Latin1_General_BIN, 'THECONTENT', 'TheContent')
from StringResource
where charindex('THECONTENT', ContentValue COLLATE Latin1_General_BIN) > 0
This will match and replace 'THECONTENT'
, but not 'TheContent'
or 'thecontent'
.