Question

Hi i want to add a column inside my SQL Server 2008 R2, which stored a Switch Ports numbers , which always have positive numbers such as 1 ,2, 3 ,4 , 5,6 ,etc... I can use Integer, but is there a more appropriate data type for storing positive integers ? Thanks

Was it helpful?

Solution 2

Tinyint

A SQL Server system datatype, it is a tiny integer column that holds whole numbers between 0 and 255, inclusive. Storage size is 1 byte.

The TinyInt allow you to insert Positive numbrs only but you can have values between 0 and 255...

See Demo here

SQL SERVER NUMERIC DATATYPE

OTHER TIPS

No, there is not. SQL server doesn't support unsigned integers.

Some more details on this can be found on Why doesn't SQL Server support unsigned datatype?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top