SQL Server displays empty resultset instead of Unicode characters after I changed collation

I created a table Tab with nvarchar(max) field Fld. With default Latin collation the next code

update Tab set Fld = N'текст' where ID = 50

select Fld from Tab where ID = 50

It returns ????

After I changed collation to Cyrillic SQL Server displays empty recordset. Please help.

Upvotes: 0

Views: 123

Answers (1)

Daniel Fisher  lennybacon
Daniel Fisher lennybacon

Reputation: 4194

It looks fine. Sure you had the "N" in front of your quoted text value?

If I run the reproduction:

CREATE DATABASE [i18n_Latin1_General_CI_AS] COLLATE Latin1_General_CI_AS;
GO

USE [i18n_Latin1_General_CI_AS];
CREATE TABLE [NLocations] ([Place] nvarchar(15) NOT NULL);  
GO  

INSERT [NLocations]([Place]) VALUES (N'текст');  
GO 

SELECT [Place] as [Order with Unicode and Latin1_General_CI_AS] FROM [NLocations] ORDER BY [Place] ASC;

USE [master];
GO

DROP DATABASE [i18n_Latin1_General_CI_AS];
GO

It returns:

enter image description here

Upvotes: 1

Related Questions