문제

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