By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

What is the range for smallint

ganeshkumar08
P: 31
Hi SQL Friends

I know that smallint ranges from -32768 to 32767 i.e from negative to positive values. why cant i store only positive values upto 65535.

i need to store upto 50000 range data, for thins i cant go for int because it occupy 4 bytes. it is waste of memory.

ok thanks
Ganesh
Feb 13 '08 #1
Share this Question
Share on Google+
2 Replies


amitpatel66
Expert 100+
P: 2,367
Hi SQL Friends

I know that smallint ranges from -32768 to 32767 i.e from negative to positive values. why cant i store only positive values upto 65535.

i need to store upto 50000 range data, for thins i cant go for int because it occupy 4 bytes. it is waste of memory.

ok thanks
Ganesh
Yes you will not be able to store the value 50,000 because SMALLINT can hold the values from -32767 to +32767.

You need to go for INT datatype
Feb 13 '08 #2

ganeshkumar08
P: 31
ok thanks for your response...
Feb 13 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.