The problem is as follows. I create a base

create database MyTestDB on primary (name = MyTestDB, filename = 'd:\MyTestDB.mdf', size = 12MB, maxsize = 20MB, filegrowth = 2MB ) LOG ON (name = MyTestDB_Log, filename = 'd:\\MyTestDB_Log.ldf', size = 2MB, maxsize = 12MB, filegrowth = 1MB) COLLATE Latin1_General_CI_AI; 

Then I create a tablet.

 CREATE TABLE Students( ID int IDENTITY(1,1) NOT NULL CONSTRAINT PK_Students PRIMARY KEY, Name nvarchar(30) NOT NULL ) 

Well, actually fill it (text fields - Cyrillic). As a result, all that is Cyrillic in this form ?????
Tell me what could be the problem ? Somewhere with the coding nakosyachil? Yes, like universal.

  • COLLATE Latin1_General_CI_AI - Mirdin
  • It is with this encoding that I create. - Pyrejkee
  • Latin1_General = 1252 - Mirdin 8:50 pm
  • @Mirdin nvarchar, and here collate - PashaPash
  • @KirillKiryanchikov exactly how do you fill in and how exactly do you select the data? Maybe just when filling a string as a 'строка' instead of N'строка' set? - PashaPash

1 answer 1

Unicode string literals - nvarchar - must be specified with the prefix N:

 N'Иванов' 

Without a prefix, the string will be converted using the code page of the base , and some of the characters will most likely be damaged:

Prefix Unicode Character String Constants with the letter N. Do not recognize certain characters.