December 9, 2008 at 1:55 pm
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.
December 9, 2008 at 2:07 pm
Alter the table as the following to support the Greek character.
ALTER TABLE test1
ALTER COLUMN title nvarchar(200) COLLATE greek_ci_as
December 9, 2008 at 2:55 pm
Thank you, but it did not work.
Is there a database-level collation that might be effecting this?
December 10, 2008 at 7:43 am
This worked:
create table test1 (title nvarchar(200) COLLATE greek_ci_as)
INSERT INTO test1 (title)
VALUES (N'FceRI-mediated activity')
select * from test1
The "alter" works for columns already present.
December 10, 2008 at 10:00 am
The collate change was unnecessary. Not having to change collation makes testing a large application much simpler.
December 10, 2008 at 10:07 am
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'FceRI-mediated activity' )
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply