datetime century date into pad dynamic cursor money percent sp job isnumeric isdate over update
SQLUSA.com
SQL 2008 GRAND SLAM ON 49 CD
FREE TRIAL  CLICK HERE TO ORDER  SEARCH
SQL Server Training SQL 2005 Scripts SQL 2008 Articles
SQL JOBS News Format Developer
How to handle Chinese, Japanese and Korean characters?

Execute the following T-SQL scripts in Microsoft SQL Server Management Studio Query Editor to illustrate the usage of Chinese, Japanese and Korean characters within an SQL Server database using unicode encoding.

-- Chinese, Japanese and Korean letters as UNICODE (2 bytes) characters

DECLARE @CHIuni nchar(1) = N''

SELECT CONVERT(binary(2),@CHIuni), UNICODE(@CHIuni)

-- 0xFD56    22269

--------------

USE AdventureWorks2008;
GO
-- SQL Chinese, Japanese and Korean characters - collations
-- Microsoft SQL Server unicode - nvarchar - 2 bytes per character
CREATE TABLE Sales.OrientalExpress (
  ID              INT    IDENTITY ( 1 , 1 ) PRIMARY KEY,
  FirstName       NVARCHAR(10),
  LastName        NVARCHAR(10),
  Address         NVARCHAR(50),
  City            NVARCHAR(20),
  State           NVARCHAR(2),
  Country         NVARCHAR(20),
  Zipcode         NVARCHAR(10),
  ModifiedDate    DATETIME default(getdate()))
GO
 
INSERT Sales.OrientalExpress(FirstName, LastName, Address, City,
State, Country, Zipcode)
SELECT N'零零四一二', N'零零六一零', N'一三二二四五 持質 室品社者手週習 五三',
N'店問冬道問堂冬', N'教弟', N'五九八六七', N'13663'
GO
 
SELECT * FROM Sales.OrientalExpress
GO
/* Results to TEXT
 
ID          FirstName  LastName   Address                                            City                 State Country              Zipcode    ModifiedDate
----------- ---------- ---------- -------------------------------------------------- -------------------- ----- -------------------- ---------- -----------------------
1           零零四一二      零零六一零      一三二二四五 持質 室品社者手週習 五三                               店問冬道問堂冬              教弟    五九八六七                13663      2009-03-02 16:16:43.890
*/
 
-- MSSQL unicode encoding of Chinese letters
SELECT            CONVERT(varbinary, left(FirstName,1)),
                  left(FirstName,1)
FROM Sales.OrientalExpress
GO
-- 0xF696  
 
-- Cleanup
DROP TABLE Sales.OrientalExpress
GO

------------
 
Related articles:

Why is sql server storing question mark characters instead of Japanese characters in NVarchar fields?

Chinese characters issue with T-SQL

 

Order SQL 2008 GRAND SLAM Today!
SQLUSA.com Home Page
SQL Server Training at www.sqlusa.com.
Microsoft SQL Server 2012 Training Videos at www.sqlusa.com.
SQL Server 2008 Video Training at www.sqlusa.com.
SQL Server 2005 Training Videos at www.sqlusa.com.
Accounting
Administrative
Advertising
Arts
Architecture
Banking
Business Intelligence
Career Jobs
Celebrity
Computer
Consulting
Customer Service
Education
Engineering
Entertainment
Entry Level
Executive
Federal
Finance
Government
Hardware
Healthcare
Hospital
Human Resources
Information Technology
Insurance
Internet
Job Openings
Laboratory
Law Enforcement
Legal
Logistics
Manufacturing
Marketing
Medical
Military
Nursing
Pharmaceutical
Physician
Public Relations
Publishing
Real Estate
Restaurant
Retail
Sales
Social Media
Software
SQL Database
Telecomm
Therapist
Training
Transportation
Truck Driver
Travel
Web
Work from Home

FREE SS SQL / BI OLAP Short Videos on YOUTUBE.com

Microsoft Community Contributor 2011 Microsoft Community Contributor 2012

Search SQLUSA FREE SQL Server Articles & FREE T-SQL Scripts

JOIN US ON TWITTER

Copyright 2005-2012, SMI Corp. All Rights Reserved.

SQL Server 2012 is a program product of Microsoft Corporation.
SQL Server 2008 is a program product of Microsoft Corporation.
SQL Server 2005 is a program product of Microsoft Corporation.
SQL Server 2000 is a program product of Microsoft Corporation.