## Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

### Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

Hello,

I want to have an integer that is 64K, but no negitives?  Smallint will
do -32000 to 32000, but I would like to have 0 to 64000.

Thanks,

Jack

### Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

jack,

Quote:> I want to have an integer that is 64K, but no negitives?
> Smallint will do -32000 to 32000, but I would like to have 0 to
> 64000.

Then you'll have to use an INT (long integer). SQL Server does not
support unsigned integer data types.

Linda

### Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

Jack,

I would suggest using an integer and placing a check constraint on the
column that will not allow values less than zero or greater than 64000.

Daran

Quote:> Hello,

> I want to have an integer that is 64K, but no negitives?  Smallint will
> do -32000 to 32000, but I would like to have 0 to 64000.

> Thanks,

> Jack

### Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

The values in the column have to be -32K to 32K, but you could just add 32K
to every value before you used it.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com

Quote:> Hello,

> I want to have an integer that is 64K, but no negitives?  Smallint will
> do -32000 to 32000, but I would like to have 0 to 64000.

> Thanks,

> Jack

### Need to see if I can get a smallint to go from 0 to 64000 and not -32000 to 32000

There is no unsigned smallint but you have a few alternatives:
1. Use an int with a check constraint. That would save you worlds of pain.
Downside is that you use 4 bytes instead of 2.
2. Use a binary(2). You can still insert integer values, but the default
output is hexadecimal, and you can't make it an identity column.
3. Use a smallint. You need to subtract 32768 when inserting, and add 32768
when selecting. This can be confusing though.

Quote:> Hello,

> I want to have an integer that is 64K, but no negitives?  Smallint will
> do -32000 to 32000, but I would like to have 0 to 64000.

> Thanks,

> Jack

we have a problem
it appears that there is a max of 32767 records allowed in a Paradox
table.
but we need more....much more....

what can we do?
use another table type?
some setting to change it to much more?

we also can't find anywhere that this value is specified in the help
or documentation (D5 pro) , else we would have known before we
started and used something else or used a different design to
accomodate our dataset.