Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

insert special char to column Expand / Collapse
Author
Message
Posted Thursday, September 16, 2010 4:49 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 6, 2011 12:54 AM
Points: 158, Visits: 151
Hi all,

I am inserting column value as 'sqlserver → 2005' But, it is inserted as 'sqlserver ? 2005'

Pls give the solution to insert Like 'sqlserver → 2005'

Thank'q
Post #987087
Posted Thursday, September 16, 2010 4:54 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 14,469, Visits: 38,079
you'll need to change the definition of the column from varchar to nvarchar.
the issue can be seen in this example...special charcters get converted to question marks if a varchar field (or a sloppy insert that implicitly converts it as a varchar)
select convert(nvarchar(30),N'sqlserver → 2005' ),
convert(varchar(30),N'sqlserver → 2005' )
--results
/*
sqlserver → 2005 sqlserver ? 2005
*/



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #987096
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse