What is the data type to the currency value in SQL Server.
e.g: I want to store $11.23.
Can I use money type and addtionally will it store the $ symbol?
answering to the question in the title, the datatype for currency is MONEY.
the money datatype will store the information only, without the format: in your example the information is 11.23 so that's what is saved into the database.
the $ sign is part of the format so it will not be stored into the money field.
the usual solution is to have a MONEY field for the amount and a VARCHAR field for the currency symbol/name.
money isn't useful as it doesn't store any currency info. It's simply a decimal type with less precision than a decimal. It also doesn't allow you to specify precision, eg when values are allowed to only have 2 decimals. What does 21.3455 $ mean?MONEY (knowing its specifications) fits then can be a valid choice as any other datatype.I think the best way to store the currency is to use either NUMERIC or DECIMAL data types as these values participates in calculations. If we use NVARCHAR to allow the storage with symbol like ($), it will cost extra during calculations when use in WHERE clause. We can choose the precision and scale accordingly.
numericdata type will not store anysymbolif you put symbol you have to phase lot of problem to calculate that amountmoney, it doesn't store any currency info, has limited range and a hard-coded precision of 4. Typically adecimalwith a specific range and precision is used, egdecimal(9,2)specifies 9 digits, 2 of which are decimals.moneymore for for compatibility with VB6 and OLEDB than anything else