Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Greek letters clobbered Expand / Collapse
Author
Message
Posted Tuesday, December 9, 2008 1:55 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 2, 2014 8:21 AM
Points: 168, Visits: 423
I need to store information with occasional Greek characters. My
SELECT CONVERT (nvarchar, SERVERPROPERTY('collation')) is SQL_Latin1_General_CP1_CI_AS

Test script:

create table test1 (title nvarchar(200)
INSERT INTO test1 (title )
VALUES ('FcεRI-mediated activity' )
select * from test1

converts the third character from epsilon to "e"

How can I store unicode data correctly?

Thank you for assistance.



Post #616498
Posted Tuesday, December 9, 2008 2:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, January 6, 2011 10:38 AM
Points: 182, Visits: 191
Alter the table as the following to support the Greek character.

ALTER TABLE test1
ALTER COLUMN title nvarchar(200) COLLATE greek_ci_as
Post #616513
Posted Tuesday, December 9, 2008 2:55 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 2, 2014 8:21 AM
Points: 168, Visits: 423
Thank you, but it did not work.

Is there a database-level collation that might be effecting this?



Post #616543
Posted Wednesday, December 10, 2008 7:43 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 2, 2014 8:21 AM
Points: 168, Visits: 423
This worked:

create table test1 (title nvarchar(200) COLLATE greek_ci_as)
INSERT INTO test1 (title)
VALUES (N'FcεRI-mediated activity')
select * from test1

The "alter" works for columns already present.



Post #617028
Posted Wednesday, December 10, 2008 10:00 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 2, 2014 8:21 AM
Points: 168, Visits: 423
The collate change was unnecessary. Not having to change collation makes testing a large application much simpler.


Post #617192
Posted Wednesday, December 10, 2008 10:07 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, May 30, 2014 6:27 PM
Points: 2,808, Visits: 7,175
You won't need to change the collation at all.

The reason it is not storing unicode is because you are not passing the string as Unicode.

add the leading unicode N before your string and this will work.

eg
INSERT INTO [test1] (
[title]
) VALUES (N'FcεRI-mediated activity' )

Post #617200
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse