John John
John John

Reputation: 1

Sql server datatypes , for storing a Positive number

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

Upvotes: 3

Views: 8050

Answers (2)

Vignesh Kumar A
Vignesh Kumar A

Reputation: 28413

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

Upvotes: 2

Tomas Pastircak
Tomas Pastircak

Reputation: 2857

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?

Upvotes: 5

Related Questions