views:

75

answers:

1

I know that the Sql equivalent of Int16 is SqlInt16.

But what is the Sql equivalent of UInt16, UInt32 and Uint64?

+2  A: 

Except for tinyint, there are no native unsigned types in SQL server so there is no good equivalent. The best you can do is use a bigger precision number and add a constraint on the permissible values.

JaredPar
MySQL has the UNSIGNED attribute, if you can use it.
LiraNuna
But what would be the case of UInt64? What would be thye bigger precision?
JMSA
@JMSA, I'm not familiar enough with SQL's data types to provide a good answer to that. Hopefully someone else will chime in with a bigger type that can suite this need.
JaredPar
Assuming SQL Server, for Unit 64: decimal(20,0) with a check constraint between 0 and 18,446,744,073,709,551,615.
Shannon Severance