I am using Sql Server 2008 and one of our requirements is to provide multi-lingual support. The main languages are English, German, French and Japanese.
I have a table which has its COLLATION as Latin1_General_CI_AS. The column that will store the text data has this COLLATION ‘Japanese_CI_AS’
When I run the following SQL in SQL Server Management Studio (SSMS)
DECLARE @translation nvarchar(max)
SET @translation = 'クッキー(Cookie)を許可してください'
PRINT @translation
UPDATE [ResourceTranslations]
SET Translation = @translation
WHERE Id = 4
The value inserted is ‘????(Cookie)?????????’, which is also the value that is printed out.
Is there any chance that SSMS is having problems with the Japanese characters? It seems that the print statement is telling me that the value is being altered to ‘????(Cookie)?????????’ before it gets inserted in the table.
Any help or advice gratefully accepted.
You are missing the
Nprefix required for string literals to be treated asnvarcharrather thanvarcharso the string literal gets coerced intovarcharin your database’s default collation first losing those japanese characters in the process.The following should work as expected.