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

Select dialog showing result of 1 row.

It is also possible to use them in arithmetic calculations

SELECT $+5

returns 5.00

SELECT 45-£

returns 45.00

SQL Server SELECT statement results.

How many of you know this?

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

Previous Post
SQL SERVER – SCRIPT – SQL Listening on Dynamic Port?
Next Post
SQL SERVER – Marking Filegroup as ReadOnly with SQL Server

Related Posts

No results found.

2 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.