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 2005 Forums
 SQL Server Administration (2005)
 Collation - not able to insert non english data

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2008-11-24 : 11:27:21
Can someone tell me what is wrong with the following code? Only ????? gets inseretd in the table.

drop table temptest
DECLARE @SQL nvarchar(1000)
DECLARE @rawvalue nvarchar(1000)

SET @rawvalue= N'?????????????'

CREATE TABLE [dbo].[temptest]( [test] [nvarchar](1000))

SET @SQL='INSERT INTO temptest (test) VALUES ('''+@rawvalue+ ''')'

EXEC(@SQL)

--INSERT INTO #temptest (test) VALUES (@rawvalue)

select * from temptest



------------------------
I think, therefore I am - Rene Descartes

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2008-11-24 : 11:28:57
SET @rawvalue= N'?????????????' -- the question marks here are actually Japaneese charcter set. Looks like the forum doesn't support them.


------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-24 : 11:34:26
does your collation support japanese characters?
check the links below for selecting correct collation

http://msdn2.microsoft.com/en-us/library/ms144250.aspx


http://msdn2.microsoft.com/en-us/library/ms180175.aspx
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2008-11-24 : 11:46:09
Got it! Forgot to put N in the dynamic sql.

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page
   

- Advertisement -