x
login about faq Site discussion (meta-askssc)

Storing Greek Symbols in SQL Server 2000

Hi, Does anybody knows how to store greek symbols (alpha, gamma, delta) in SQL Server 2000 table?

Thanks, Ashesh

more ▼

asked Dec 11 '09 at 03:52 AM in Default

Ashesh gravatar image

Ashesh
13 2 2 2

Can you give us the DDL for your tabel? I think you might need to set the proper code page/collation for this table.

Dec 11 '09 at 12:20 PM Steve Jones - Editor ♦♦
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

EDIT: Replace previous code snippets with 1 complete snippet using a table variable.

You should be able to do this using a Greek collation for an nvarchar column.

I found this page with Greek characters: http://ancienthistory.about.com/od/greeklanguage/a/ASCIIGreek.htm

DECLARE @GreekAlphabet TABLE
(
    english nchar(1) not null,
    greek nchar(1) COLLATE Greek_BIN not null,
    greek_name varchar(10) not null
)

INSERT INTO @GreekAlphabet (english, greek, greek_name)
    SELECT N'A', N'Α', 'ALPHA'
    UNION
    SELECT N'a', N'α', 'alpha'
    UNION
    SELECT N'B', N'Β', 'BETA'
    UNION
    SELECT N'b', N'β', 'beta'
    UNION
    SELECT N'G', N'Γ', 'GAMMA'
    UNION
    SELECT N'g', N'γ', 'gamma'
    UNION
    SELECT N'D', N'Δ', 'DELTA'
    UNION
    SELECT N'd', N'δ', 'delta'

SELECT * FROM @GreekAlphabet

Results:

english greek	greek_name
A   Α	ALPHA
a   α	alpha
B   Β	BETA
b   β	beta
D   Δ	DELTA
d   δ	delta
G   Γ	GAMMA
g   γ	gamma
more ▼

answered Dec 11 '09 at 04:13 AM

Tom Staab gravatar image

Tom Staab
5.8k 5 8 10

This didn't work. e.g. when I want to store Δ (i.e. Greek Delta) should my SQL should be INSERT INTO MyTable (greek) VALUES(N'Δ') or INSERT INTO MyTable (greek) VALUES(N'&#916')

Dec 11 '09 at 06:31 AM Ashesh

Either way it don't work for me.

Dec 11 '09 at 06:32 AM Ashesh

Try the new code I just posted. It works in SQL Server 2008. I don't have 2000, but I don't see why it wouldn't work there.

Dec 11 '09 at 10:17 AM Tom Staab

Thanks Tom, This has worked. Thanks again Ashesh

Dec 22 '09 at 01:30 PM Ashesh
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x913

asked: Dec 11 '09 at 03:52 AM

Seen: 1158 times

Last Updated: Dec 11 '09 at 03:52 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.