开发者

Money vs Decimal datatypes when using LINQ to SQL

开发者 https://www.devze.com 2022-12-17 05:12 出处:网络
There are lots of discussion about using MONEY or DECIMAL datatypes in SQL Server for holding financial data. It seems all it is about possible lost of precision when using MONEY datatype.

There are lots of discussion about using MONEY or DECIMAL datatypes in SQL Server for holding financial data. It seems all it is about possible lost of precision when using MONEY datatype.

If I understand it right, this situation may take place when we do calculation with these values in stored procedures using T-SQL.

Do I assume right, that, in case I use LINQ to SQL and all results of queries from MONEY fields are held in c# decimal variables, (and开发者_运维百科 so calculation are done using decimals) it doesn't matter what datatype to use in database (MONEY or DECIMAL) to represent money values?


I think you will find this very helpful. It shows how SQL data types are mapped to CLR data types.

http://msdn.microsoft.com/en-us/library/bb386947.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号