Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using Unicode to save Japanese text?

Author  Topic 

matt_calhoon
Posting Yak Master

235 Posts

Posted - 2005-05-10 : 23:45:49
Hi there,

We are trying to save japanese text to our ntext field using a stored proc.

just playing around with how to use the N (national) flag. This works in sql analyer:

Select N'testing'

but I cannot get it to work if I replace the literal with a variable. I.e.


declare @sql nvarchar(40)
declare @TEXT nvarchar(40)
set @TEXT = 'Testing'

set @sql = "Select N" + @TEXT
print @sql

any help appreciated.

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-05-11 : 01:44:21
quote:
Originally posted by matt_calhoon

Hi there,

We are trying to save japanese text to our ntext field using a stored proc.

just playing around with how to use the N (national) flag. This works in sql analyer:

Select N'testing'

but I cannot get it to work if I replace the literal with a variable. I.e.


declare @sql nvarchar(40)
declare @TEXT nvarchar(40)
set @TEXT = 'Testing'

set @sql = "Select N" + @TEXT
print @sql

any help appreciated.



'Select N' + '''' + @TEXT + ''''

Also in your example you are using double quotes ("), should be single ('). All the quotes in my example are single

HTH

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page
   

- Advertisement -