Tiny integers less than 0

It has just dawned on me, whilst updating my standards document and putting together some guidelines on datatype usage that a tinyint can't store negative values. Which explains why SSIS converts a tinyint to an unsigned single byte integer.

So the following will fail

select cast(-23 as tinyint)

Its amazing how obvious this was but just went straight over my head.

Published Tuesday, February 28, 2006 7:08 AM by simonsabin


No Comments