Saturday, February 25, 2012

Data lost during converting int to smallint

I am trying to keep it consistent with data from the source, I change
datatype for a field from int to smallint and it has a value between 200 and
1000.
When I do it in Enterprise Manager, I give me this warning:
- Warning: Data might be lost converting column 'auto_pre_appr' from 'int'.
Is this just a general warning?
CulamYes, it is warning and you may or may not lose some data, if you know what
the actual data values in the column and what value scope of smallint type
is (-32768 to 32767). Obviously, if the column of int contains data with
value smaller that -32768 or greater than 32767, the warning would become
reality.
"culam" <culam@.discussions.microsoft.com> wrote in message
news:2DB9A059-2D1A-44C9-8D44-32F8F7D7848C@.microsoft.com...
>I am trying to keep it consistent with data from the source, I change
> datatype for a field from int to smallint and it has a value between 200
> and
> 1000.
> When I do it in Enterprise Manager, I give me this warning:
> - Warning: Data might be lost converting column 'auto_pre_appr' from
> 'int'.
> Is this just a general warning?
> Culam

No comments:

Post a Comment