2011-01-07 202 views
2

在我們的SQL Server 2005機器上,我遇到了一個錯誤,那就是當爲具有某些字符的下游系統準備數據時,所有'f'字符都被刪除限制。在SQL Server 2005中將'φ'轉換爲'f'的問題

我發現在UDF中有一個聲明試圖用''替換'φ'字符。問題在於,至少在我們的SQL Server安裝中,'φ'和'f'是相同的東西。

有人能告訴我什麼是區分'φ'和'f'的最佳方法嗎?

例如:

select case when 'φ' = 'f' then 'equal' else 'not equal' end 

對於我來說,這個回報「等於」

+1

什麼** **整理你有你的服務器上,並在你的數據庫? – 2011-01-07 16:32:22

+0

剛剛檢查。它是SQL_Latin1_General_CP1_CI_AS。 – smcmahon 2011-01-07 16:35:28

回答

6

使用字符串字面N'φ'所以它不會強制爲默認的排序規則。

對我來說(下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*/