Short
Name |
. NET Class |
Type |
Width |
Range (BITS) |
SQL Datatype (Closest Match) |
Constraint to use (if needed in table definition) |
Byte |
Byte |
Unsigned integer |
8 |
0 to 255 |
tinyint |
|
SByte |
SByte |
Signed integer |
8 |
-128 to 127 |
smallint |
[ColName] Between-128 and 127 |
Int |
Int32 |
Signed integer |
32 |
-2,147,483,648 to 2,147,483,647 |
Int |
|
UInt |
UInt32 |
Unsigned integer |
32 |
0 to 4294967295 |
bigint |
[ColName] Between 0 and 4294967295 |
Short |
Int16 |
Signed integer |
16 |
-32,768 to 32,767 |
smallint |
|
UShort |
UInt16 |
Unsigned integer |
16 |
0 to 65535 |
Int |
[ColName] Between 0 and 65535 |
Long |
Int64 |
Signed integer |
64 |
-922337203685477508 to 922337203685477507 |
bigint |
|
ULong |
UInt64 |
Unsigned integer |
64 |
0 to 18446744073709551615 |
Decimal (20,0) |
[ColName] Between 0 and 18446744073709551615 |
Float |
Single |
Single-precision floating Point type |
32 |
-3.402823e38 to 3.402823e38 |
Real |
|
Double |
Double |
Double-precision floating Point type |
64 |
-1.79769313486232e308 to 1.79769313486232e308 |
Float |
|
bool |
Boolean |
Logical Boolean Type |
8 |
True or False |
Bit |
|
Decimal |
Decimal |
Precise fractional or integral type that can represent decimal numbers with significant digits |
128 |
±1.0x10e-28 To±7.9x10e28 |
Decimal (can go-significant in SQL need-to-limit to-here.) |
|
The correspondence between C # data types and SQL and the range of values