I have the following columns: Qty, Cost, Margin, ListPricec, DeptDotSubdept that I need to create in a SQL Server Compact database table. Qty seems like it should be an int, but you can actually have, say 1.5 of this or that, so it needs to not be an int. The next three (Cost, Margin, and ListPrice) are monetary vals. The last one is a "fake" double which combines a department number and a subdepartment number to be a single entity; e.g., dept 42, subdepartment 99 are stored as "42.99"

What SQL Server Compact data types are best for these types? There is no "money" or "currency" type, dagnab it. In the corresponding C# class, all of these class members are doubles.

有帮助吗?

解决方案

I think you probably want to use a datatype of FLOAT. I'm not having any luck finding a link to data type documentation for SqlCE right now. I'll update if I find something.

Update: SqlCE 4.0 DataTypes

NUMERIC is probably your best choice.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top