What is the equivalent datatype of SQL Server’s Numeric in C#

There isn’t a direct equivalent, in that there are no built-in .NET types which allow you to specify the precision/scale explicitly as far as I’m aware. There’s no fixed-point type like NUMERIC.

decimal and double are the common floating point types in .NET, with decimal implementing decimal floating point (like NUMERIC in T-SQL) and double implementing binary floating point behaviour (like FLOAT and REAL in T-SQL). (There’s float as well, which is a smaller binary floating point type.)

You should choose between decimal and double based on what values you’re going to represent – I typically think of “man-made”, artificial values (particularly money) as being appropriate for decimal, and continuous, natural values (such as physical dimensions) as being appropriate for double.

Leave a Comment