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

有帮助吗?

解决方案 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

其他提示

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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top