Click here to Skip to main content
15,888,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

Please tell me the query to insert current rupee symbol in sql server.
I have to display all the currency symbols in a combo box.

SQL
INSERT INTO dbo.currency (country,currency,code,symbol) VALUES ('India','Rupees','INR',NCHAR(8425));     


I tried the above but it's not showing the output.

Thank you
Posted
Updated 25-Feb-17 4:56am
Comments
aboubkr90 2-Nov-13 6:46am    
Try "edit top 200 rows" on table currency to see if it IS there (it might be the query, UI or something else)

As Rupee is a unicode symbol, you need to use a font that is having this glyph in it. As I see, it is not supported by default in Window, you have to apply a patch: http://support.microsoft.com/kb/2496898[^]. But this is not enough, you have to change the font of the grid result in SQL Server Management Studio and choose a proper font (http://technet.microsoft.com/en-us/library/ms189708.aspx[^]). To check if the symbol glyph is available or not, start charmap.exe and search for the code 20B9 (see: http://windows.microsoft.com/en-us/windows-vista/using-special-characters-character-map-frequently-asked-questions[^])

Update:
1) Use "Tahoma" font. After the update it is for sure supporting the symbol.
2) The code you have used seems not to be the INR symbol unicode code. It should be 8377 (this decimal value is equivalent with hex 20B9). If you run following statements, you should see for yourself:
SQL
select UNICODE(N'₹'), NCHAR(8377)
 
Share this answer
 
v2
See here:
how to insert unicode text to SQL Server from query window[^]

Which would lead to:
SQL
INSERT INTO dbo.currency (country, currency,code, symbol) VALUES ('India', 'Rupees', 'INR', N'₨');


Note: the text column has to be of type nvarchar or nchar.
 
Share this answer
 
Just to add to the Solution #3 mentioned by Zoltan Zargo

In most cases, SQL Server Script files are set to the "Western European (Windows) - Codepage 1252" encoding. Hence, the INR rupee symbol does not often appear correctly. The default font chosen in the Script Editor might allow the display of the character, but while saving the script file, SSMS will indicate the anomaly.

Hence, without altering the encoding, you could simply adopt the NCHAR function. For example (extending upon what has already been pointed out earlier in the thread), shows the various ways how this could be achieved:

SQL
select UNICODE(N'₹'), NCHAR(8377), 'INR ' + NCHAR(8377)


Hope this helps.
 
Share this answer
 

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