Can I use Unicode as Primary Key? For example, Chinese Character. <eom>Sean
Any reasons? Please read "Defining a Primary Key" article in the BOL.
"Sean" <ventilla@.hotmail.com> wrote in message
news:%23ecL5hvKGHA.744@.TK2MSFTNGP09.phx.gbl...
>|||Yes. Any CHAR/NCHAR/VARCHAR/NVARCHAR column(s) upto 900 bytes total
size. In SQL Server 2005 you cannot use the (N)VARCHAR(MAX) datatype as
a key.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Thanks a lot!
But when I link the database using Access Database, all the records with
Chinese character will appears as "#Deleted" in the table in Access. What is
wrong? Any idea?
Thanks again.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1139218262.315786.78000@.g47g2000cwa.googlegroups.com...
> Yes. Any CHAR/NCHAR/VARCHAR/NVARCHAR column(s) upto 900 bytes total
> size. In SQL Server 2005 you cannot use the (N)VARCHAR(MAX) datatype as
> a key.
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||Sean
As David has mentioned you should use NVARCHAR(n)/NACHAR(n) datatype to
transfer unicode characters
CREATE TABLE #Test (Col NCHAR(12))
DECLARE @.nstring nchar(12)
SET @.nstring = N'?kergatan 24'
INSERT INTO #Test VALUES (@.nstring )
"Sean" <ventilla@.hotmail.com> wrote in message
news:edGjTJwKGHA.2304@.TK2MSFTNGP15.phx.gbl...
> Thanks a lot!
> But when I link the database using Access Database, all the records with
> Chinese character will appears as "#Deleted" in the table in Access. What
> is wrong? Any idea?
> Thanks again.
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:1139218262.315786.78000@.g47g2000cwa.googlegroups.com...
>|||One of my customer enters Chinese characters as the primary key.
That's why I am headache now.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eZKNNlvKGHA.3896@.TK2MSFTNGP15.phx.gbl...
> Sean
> Any reasons? Please read "Defining a Primary Key" article in the BOL.
>
>
> "Sean" <ventilla@.hotmail.com> wrote in message
> news:%23ecL5hvKGHA.744@.TK2MSFTNGP09.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment