Click here to Skip to main content
15,909,466 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
I have rows with unicode data in my database. after selecting those data its shows like boxes([]). what to do if we want to view unicode data in correct format in MS sql result grid.
Posted

1 solution

Hi there,
You should use a 'N' prefix.
This denotes that the subsequent string is in Unicode (the N actually stands for National language character set). Which means that you are passing an NCHAR, NVARCHAR or NTEXT value, as opposed to CHAR, VARCHAR or TEXT.


for example:
INSERT INTO ... VALUES (N'String',N'String';...
UPDATE ... SET ...=N'String'...WHERE ...=N'String'
SELECT ... FROM ... WHERE ...=N'String'.
 
Share this answer
 
v2
Comments
Hiren solanki 3-Nov-10 23:18pm    
Good answer, and Edited code blocks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900