Reputation: 1
I have a column inside sql server 2008 r2 of type Biginit
, and when i map the sql server table using entity framework, it automatically assign the Biginit a long
datatype. my question is weather such conversion is correct or should be overridden ? in other words is SQL server 2008 Biginit 100% equivalent to .Net Long ?
second question is .Net Long 100% equivalent to .Net Int64 ?
Upvotes: 1
Views: 1451
Reputation: 52518
The internal .Net datatype is Int64
. This is a 64 bit signed integer. long
is an alias for Int64
. Probably because it looks more C#-ish.
BigInt
is also a 64bit signed integer. It is essentially the same (has the same domain/range) as other signed 64-bit integer types. With one exception, BigInt
can have a null value, and has this behavior by default.
So actually:
BigInt
= long?
= Nullable<long>
BigInt NOT NULL
= long
Upvotes: 2
Reputation: 78555
SQL's bigint
is equivalent to C#'s Int64
.
long
is just syntactic sugar for Int64
, same as string
and String
or int
and Int32
.
So bigint == long == Int64
.
Upvotes: 3