martedì 27 novembre 2012

Insert Japanese Characters in SQL Server

To insert Japanese Characters or when dealing with Unicode string constants in SQL Server, you must precede all Unicode strings with a capital letter N, and you need to use nvarchar for the colums.

If you do not prefix a Unicode string constant with N, SQL Server will convert it to the non-Unicode code page of the current database before it uses the string.

Use this meta in the webpage as well:


An example of query will be:


INSERT INTO dbo.sample VALUES (
 '12345'
 ,N'を許可し
 );