mattytommo mattytommo - 1 year ago 184
C# Question

SQL equivalent of C# BigInteger

So, I've been using the new

class introduced in .NET 4 to store incredibly large numbers.

Now, I've started thinking about saving these numbers to the database (SQL Server). My question is, is this even possible? As far as I know and what I've researched, the SQL data types do not contain a property that corresponds to the behaviour of
(theoretically no min or max).

The closest I've seen is
, but that has a minimum of
-2^63 (-9,223,372,036,854,775,808)
and a maximum of
2^63-1 (9,223,372,036,854,775,807)

Answer Source

If your SQL server's DECIMAL type does not support the precision you need you'll only have the option to store the number as a string or a binary, i.e. in a VARCHAR, TEXT or `VARBINARY`` field.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download