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 2008 Forums
 Transact-SQL (2008)
 Convert to Nvarchar

Author  Topic 

Adis
Starting Member

2 Posts

Posted - 2010-06-13 : 04:10:38
How can I show this sign '?' ?
Please Help!
Adi.

declare @var varchar(20)
set @var = N'?'

select @var
select convert(nvarchar(20),@var)
select cast(@var as nvarchar(20))

Kristen
Test

22859 Posts

Posted - 2010-06-13 : 06:10:18
I get "?" on all three outputs ...

Try adding a test for:

select ASCII(@var)

I get 63 - ASCII value for "?"

If you get something different try changing the assignment to:

set @var = CHAR(63)

instead? (or use whatever ASCII value your language needs for "?" in place of the "63")
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-13 : 07:39:53
Maybe the OP doesn't mean '?' and has problems to post the needed sign here?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-13 : 08:45:12
Ah, good point, Well in that case the CHAR(nnn) value should do the trick?
Go to Top of Page
   

- Advertisement -