SQL Server query does not find a row in the database

I have this line in my SQL Server database:

Province    City                                LocationText
-------------------------------------------------------------------------------
İstanbul    İstanbul Sabiha Gökçen Havalimanı   Ä°stanbul Sabiha Gökçen Airport

      

And I copy and paste the city name above as a test in the following query:

select * 
from Locations 
where City ='İstanbul Sabiha Gökçen Havalimanı'

      

But the request returns No Result Found

. What am I missing here?

+3


source to share


2 answers


If it's a column NVARCHAR

, you might be lucky with the prefix N

:

select * from Locations where City = N'İstanbul Sabiha Gökçen Havalimanı'

      



See here a Microsoft support article describing the use of the prefix N

when working with Unicode values.

+6


source


My best guess is that this is a known bug in MS SQL Server. Take a look at the link:

Turkish language. If you are using MS SQL Server you may have problems using TURKISH_CI_AS due to this SQL Server error.



(And another link )

I suggest changing the city to exclude the special characters ( İ ö ç ı

) and then adding them one by one to check which one is the problematic one.

+1


source







All Articles