3

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

1
  • Nope. int and a CHECK constraint if you want to be sure is about the best. Commented Apr 25, 2014 at 10:55

2 Answers 2

5

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?

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.