6

Inserting multilingual data into a SQL 2008 database (nvarchar field) I notice that it seems to lose some special character marks.

e.g.

    INSERT INTO [dbName].[dbo].[tbl_Question_i18n]  
           ([QuestionId]  
           ,[LanguageId]  
           ,[QuestionText])  
     VALUES  
           (@lastinsertedquestionid  
           ,@romanian  
           ,'Număr unic de referinţă (URN)')  

gets inserted as 'Numar unic de referinta (URN)'

although if I do 'Edit top 200 rows' I can paste the same text directly into that field with no problem.

What am I missing, please?

gbn
  • 422,506
  • 82
  • 585
  • 676
zombiejojo
  • 75
  • 1
  • 6

1 Answers1

10
INSERT INTO [dbName].[dbo].[tbl_Question_i18n]  
       ([QuestionId]  
       ,[LanguageId]  
       ,[QuestionText])  
 VALUES  
       (@lastinsertedquestionid  
       ,@romanian  
       ,N'Număr unic de referinţă (URN)')

You need the N before the string constant to make it Unicode

gbn
  • 422,506
  • 82
  • 585
  • 676