Alper Barkmaz (kusmuk@reflected.org) writes:
[quoted text, click to view] > After many researches, we got a new point about this situation.
> Current SQLServer DB Collation is set to Latin1_General, but data is
> in it having Turkish characters, which is in codepage 1254 group.
>
> So, when we tried to read data from tables; all data is fetched in
> CodePage 1250 (or 1252 I do not remember exactly).
>
> New question is : Is there a way to query SQL Server pretending like
> its data is in codepage 1254? Or any REPLACE functions available for
> this specific situation?
I'm not really sure that I understand what you are trying to do, but
here is an example of what is possible:
CREATE TABLE nisse (a varchar(40) NOT NULL)
go
INSERT nisse (a) VALUES ('Alfons')
INSERT nisse (a) VALUES ('Åkermark')
INSERT nisse (a) VALUES ('Ärlig')
INSERT nisse (a) VALUES ('Betesmark')
INSERT nisse (a) VALUES ('Olofslund')
INSERT nisse (a) VALUES ('Önnestad')
INSERT nisse (a) VALUES ('Pamukkale')
INSERT nisse (a) VALUES ('Victor')
INSERT nisse (a) VALUES ('Urban')
INSERT nisse (a) VALUES ('Üsküdar')
INSERT nisse (a) VALUES ('Torrskodd')
go
SELECT * FROM nisse ORDER BY a COLLATE Finnish_Swedish_CS_AS
SELECT * FROM nisse ORDER BY a COLLATE German_Phonebook_CS_AS
SELECT * FROM nisse ORDER BY a COLLATE Turkish_CS_AS
But this only works within the given code page. If the database has the
collation Latin_General1, and you have byte 254 in a character, SQL
Server will handle it as LATIN SMALL LETTER THORN and not the character
which is there in CP1254.
Since I don't know your situation in detail, it is a little difficult
to say what you should do. If rebuilding that database is possible, you
should probably do it. If data does not match code page, you are in for
problems. You would need to use BCP to get the data out, and be sure
to specify -C RAW to avoid any conversion when you get data in and out.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se
Books Online for SQL Server SP3 at