Showing posts with label latest. Show all posts
Showing posts with label latest. Show all posts

Thursday, March 8, 2012

Chinese and Japanese characters in same colation

SQL 2000, latest SP. We currently have the need to store data from a
UTF-8 application in multiple languages in a single database.

Our findings thus far support the fact that single-byte and
double-byte characters can be held in the same DB without issue.
However, when holding two sets of DIFFERING double-byte characters
(i.e. Chinese and Japanese) there are issues.

Since Japanese has a superset of both Kanji and Katakana characters
it's our theory that the Japanese collations will hold Chinese as well
(Mandarin).

1) Has anybody tried to store multiple languages in the same db? What
collation was used?

2) Is it possible to change collation by table?

3) Which collation of Japanese should be used for best multibyte,
UTF-8 character sets? Currently we're testing with Japanese_CI_AS
(encoding MS932).

Any and all responses appreciated,

gary@.shimanoweb.comGPenn (gbpenn@.yahoo.com) writes:
> SQL 2000, latest SP. We currently have the need to store data from a
> UTF-8 application in multiple languages in a single database.

You cannot store UTF-8 data in an SQL Server database. But UTF-8 is
just an encoding form of Unicode, and in SQL Server you store Unicode
data as UTF-16.

> Since Japanese has a superset of both Kanji and Katakana characters
> it's our theory that the Japanese collations will hold Chinese as well
> (Mandarin).

Yes, Unicode unifies the Japanese and Chinese ideographs. The idea is
that if they look different, that is a font and presentation issue.

> 1) Has anybody tried to store multiple languages in the same db? What
> collation was used?
> 2) Is it possible to change collation by table?

In SQL Server you can have different collations on different columns,
so you could have

chinese_text nvarchar(23) COLLATE <some Chinese collation>
japanese_text nvarchar(23) COLLATE Japanese_xx_xx

Then whether this is a good idea, depends on your application.

> 3) Which collation of Japanese should be used for best multibyte,
> UTF-8 character sets? Currently we're testing with Japanese_CI_AS
> (encoding MS932).

That is defintely not my field of expertise, but beware that there
are also Width and Kana-sensitive variations.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Sunday, February 19, 2012

Checking last user Identity on remote server

Is it possible to get the latest inserted Identity value on a remote server?
(The following gives a NULL result:
select ident_current('[my_linked_server].thedatabase.dbo.thetable')
)@.@.IDENTITY (assuming you mean server wide irrespective of the user\ connections etc).

HTH|||Beg your pardon - @.@.Identity is specific to session - sorry - didn't read every last line of BoL before hitting Submit.|||@.@.IDENTITY (assuming you mean server wide irrespective of the user\ connections etc).
HTH

Are you sure? I think that's what I tried first. Doesn't
it give the latest Id value used in the server where
you are (so to speak), not the remote server?|||Finally, I understood this is the way to do it. Just as feedback.

DECLARE @.return_status int
EXEC @.return_status = MyLinkedServer.the_database.dbo.a_stored_procedure
SELECT 'Return Status' = @.return_stat

The SP "a_stored_procedure" is stored on the linked server. It returns
Ident_Current for the appropriate table, using RETURN, simply.