In the code below I want to select token where this token contain half space character.
Select * from
(select token = 'aaasss') as dd
where token like '%%'
favorable response:
aaasss
output response:
null
notation: This character is a Persian character and not showed with a viewable mark. But this character separate string on two sides of itself. for example: token بهترین with half space is بهترین
I think that the problem is about the collation.
For example this query :
select PATINDEX('%%','aaasss' collate Arabic_CI_AS)
Return 1, but this one:
select PATINDEX('%%','aaasss' collate SQL_Latin1_General_CP1_CI_AS)
return 4; and this is the correct position of half-space character in input string.
Therefor you must change the Collation of your input string to some Latin Collation like: SQL_Latin1_General_CP1_CI_AS