On our SQL Server 2005 machine, I encountered a bug where all the 'f' characters were getting dropped when preparing data for a downstream system that has some character limitations.
What I found was that there was a statement in a UDF that was attempting to replace 'φ' characters with ''. The problem is that, at least in our installation of SQL Server, 'φ' and 'f' are the same thing.
Can someone tell me what would be the best way to differentiate between 'φ' and 'f'?
开发者_开发技巧example:
select case when 'φ' = 'f' then 'equal' else 'not equal' end
For me, this returns 'equal'
Use N'φ'
in the string literal so it doesn't get coerced into the default collation.
For me (under SQL_Latin1_General_CP1_CS_AS
)
select case when 'φ' = 'f' then 'equal' else 'not equal' end /*equal*/
select case when N'φ' = 'f' then 'equal' else 'not equal' end /*not equal*/
精彩评论