我遇到了國際符號的數據編碼的問題都在我的本地數據庫(SQL Server 2012)和生產(Azure的SQL)國際字符不是SQL Sever的工作where語句
本來它的發生與實體框架7和Asp5-rc1,但我設法用下面的一個簡單的SQL查詢重現它。
select Source
from tag
where Source like '%dzie%'
返回與ń
行正確
顯示dzień.txt
select Source
from tag
where Source like '%dzień%' // additional 'ń' character at the end
返回空表
看起來SQL和實體框架返回值腿它(與ń
),但是當我在where
語句中使用ń
時,數據庫不返回任何結果。
然而,當我執行下面的代碼我Management Studio中
update tag
set Source = 'dzień.txt'
where Id = 'my id'
比這個查詢(同前)
select Source
from tag
where Source like '%dzień%' // additional 'ń' character at the end
這一次返回與ń
行正常顯示
dzień.txt
我需要每個角色與where
聲明一起使用。我應該怎麼做才能使其工作,特別是在Azure上。
你的LINQ查詢是什麼樣的? –
@KosalaW它很簡單,因爲它可以是'_context.Tags.Where(tag => tag.Source ==「dzień.txt」)'爲了演示我將它轉換爲在SQL中使用'like' – gisek
什麼是整理你的服務器和那個'source'列? – rene