SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Collation for Latin and Cyrillic
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hoonius
Starting Member

1 Posts

Posted - 11/19/2009 :  07:13:09  Show Profile  Reply with Quote
Hi All

I have a database which has only had to store latin characters up until now

However, it now needs to store Russian characters and, although i was able to insert the data in Russian, the returned data is all ??????? so i'm thinking the collation is incorrect

Is there a collation mode which supports both characters sets? Do i even need to change the collation? Would changing the field type to nvarchar solve the problem maybe?

Any pointers would be most welcome :¬)

cheers

Tim

tecknical9
Starting Member

1 Posts

Posted - 02/23/2010 :  16:48:18  Show Profile  Reply with Quote
quote:
Originally posted by hoonius

Hi All

I have a database which has only had to store latin characters up until now

However, it now needs to store Russian characters and, although i was able to insert the data in Russian, the returned data is all ??????? so i'm thinking the collation is incorrect

Is there a collation mode which supports both characters sets? Do i even need to change the collation? Would changing the field type to nvarchar solve the problem maybe?

Any pointers would be most welcome :¬)

cheers

Tim



Anwser by FKA
Sorry but answer is in French

to sum up the solution:
decalre your variable as NVARCHAR and then set the Value beginning with N. exemple write N'?????' not '?????'


j'ai trouvé la solution à ton problème de collation:

drop table tst_cyrilik

create table tst_cyrilik (strcyrilik nvarchar(20) not null )

insert into tst_cyrilik( strcyrilik ) values( N'?????' )

select * from tst_cyrilik

tu dois prendre en compte 2 paramètres:

1. mettre un N'ton caractère' (il est très important ce N)

2. déclarer ta variable qui va héberger le caractère cyrillique en NVARCHAR



Pas besoin de forcer ta collation à Cyrillic_General_CS_AS sur ta colonne si tu es effectivement en SQL_Latin1_General_CP1_CI_AS.



A titre d’exemple :

CREATE TABLE Datatable (
data NVARCHAR(50) COLLATE Cyrillic_General_CS_AS
)


INSERT INTO Datatable (data) VALUES (N'????? ??????????')
INSERT INTO Datatable (data) VALUES (N'?????????')

INSERT INTO Datatable (data) VALUES (N'???? ??????????? ?????????? ?????????')
INSERT INTO Datatable (data) VALUES (N'?????????')
INSERT INTO Datatable (data) VALUES (N'???????: ?????? (??????) — ???????')
INSERT INTO Datatable (data) VALUES (N'?????????')

select * from Datatable
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000