SQL SERVER – Interesting Observation with Currency Symbols

The currency symbols like $ and £ are implicitly treated as money value in SQL Server

If you run the following code

SELECT $

SELECT £

You can see that both of the above statements return the value 0.00

SQL SERVER - Interesting Observation with Currency Symbols currency1

It is also possible to use them in arithmetic calculations

SELECT $+5

returns 5.00

SELECT 45-£

returns 45.00

SQL SERVER - Interesting Observation with Currency Symbols currency2

How many of you know this?

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
Previous Post
Interview Question of the Week #011 – Script to Convert List to Table and Table to List
Next Post
SQL SERVER – Marking Filegroup as ReadOnly with SQL Server

Related Posts

No results found.

2 Comments. Leave new

Leave a Reply

Menu