0

I need to save a few values on a SQL table columns and map them to Entity Framework Entity.

The values are 2.50; 233.50, 52.43 ... So the precision is not height.

What SQL data type should I use and to what NET data type should I map it?

I could use SQL float to NET Double ... But is it the appropriated one?

Miguel Moura
  • 36,732
  • 85
  • 259
  • 481

1 Answers1

1

Consider using any of the SQL money types.... they have serious size / performance advantages if you store a lot of values as they are internally stored as integers.

On the .NET side they tranlsate natively into Decimal - which may or may not be good. Sadly the accuracy says less about what you need here as how you use them and that is something you do not say at all.

TomTom
  • 61,059
  • 10
  • 88
  • 148
  • 1
    Why use a money data type? The question doesn't mention that the values are money. Money can lead to [many problems](http://stackoverflow.com/questions/582797/should-you-choose-the-money-or-decimalx-y-datatypes-in-sql-server) if you aren't aware of its limitations. Better use the more generic decimal/numeric. – cremor Sep 16 '14 at 13:43