1

I have table with this structure :

IdCity      int 
CityName    nvarchar(20)

the data inside it is written in russian like :

+--------+----------------+
| IdCity |    CityName    |
+--------+----------------+
|      1 |    Абакан      |
|      2 |    Азов        |
|      3 |    Александров |
|      4 |    Алексин     |
+--------+----------------+

I tried to make an easy view to retrieve the rows that have city name = Азов :

SELECT       IdCity, CityName
FROM            dbo.City
WHERE        (CityName = 'Азов')

It gave me null although the record is in the table. When I tried to add a row with an english name:cityname = abc, for example and edited the view to select cityname = 'abc', it worked fine.

so how to make the sql query select the russian inputs also?

saeed foroughi
  • 1,662
  • 1
  • 13
  • 25
  • Dupehammered by mistake. Sorry. – O. Jones Jan 23 '20 at 13:33
  • Probably you didn't write the text in search correctly or the value in table might have some non printable chars that you missed. Second char for example is not number 3. Here is a fiddle demo: https://dbfiddle.uk/?rdbms=mysql_5.6&fiddle=e985dc7c173cc751471ab4a4e77cbba7 – Cetin Basoz Jan 23 '20 at 13:42
  • Please provide `SHOW CREATE TABLE` and your connection parameters. – Rick James Jan 23 '20 at 23:08

2 Answers2

0

It can be the encoding issue. make sure your CityName type is VARCHAR, not NVARCHAR. and try to run this script.

SELECT       IdCity, CityName
FROM            dbo.City
WHERE        (CityName = N'Азов')
Karvan
  • 250
  • 2
  • 7
0

The problem is when creating the database from the beginning i had to choose the encoding language for the db, can't be changed after creating it though !