February 28, 2024 at 7:42 pm
Please assist. I am using SSIS to read data from an Excel sheet into Postgres. I have increased the column size a few times, just cant seem to get the data in. Getting errors relating to destination column size.
[Excel Source [24]] Error: System.Exception: SqlTruncateException: Numeric arithmetic causes truncation.. RowNumber=1, ColumnName=Metric Value [DataType=DT_NUMERIC,Length=0], Data=[Length=12, Value=311116655.63]
at ZappySys.PowerPack.Adapter.SqlDataComponentBase.HandleException(Exception ex)
at ZappySys.PowerPack.Adapter.SqlDataComponentBase.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)
February 28, 2024 at 8:33 pm
Precision 19, scale 18 works for numbers like
1.123456789012345678
ie, 1 number before the decimal and 18 after. Are your numbers in this format?
February 28, 2024 at 8:44 pm
These are the sort of values in the Excel:
February 28, 2024 at 9:29 pm
Try changing to scale 19, precision 0.
Also, is the destination column really a 510 character string?
February 28, 2024 at 9:43 pm
19, 0 not enough as the data being truncated has at least 2 decimal places according to the error.
to the OP - if you don't know what the size should be do a initial load as text, then look at ALL the values including the number of decimal places and then define the correct size allowing for potentially 2 extra digits of precision.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy