none
64-bit error: Numeric arithmetic causes truncation.

    Question

  • An SSIS package has worked fine for a long time in 32-bit SQL Server. It now fails in 64-bit SQL Server. I run this same package in my dev environment against the same data and it works, but my dev environment is 32-bit

     

    System.Data.SqlTypes.SqlTruncateException: Numeric arithmetic causes truncation.

       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)

       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)

       at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper90 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer90[] buffers, IntPtr ppBufferWirePacket)

     

    SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Parse Into DataSet" (5196) returned error code 0x80131932.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.

     

    Any suggestions?

    Wednesday, December 19, 2007 2:38 PM

Answers

  • It turned out that this error had nothing to do with moving to 64 bit at all. It just happed that the first invalid data point ever detected in the field in question was inserted on the same day we moved to 64 bit.

    Wednesday, December 19, 2007 6:15 PM

All replies

  • Can you describe the component, "Parse Into DataSet" and how you have that setup?
    Wednesday, December 19, 2007 2:42 PM
    Moderator
  • Sure. It is a script component in a data flow that reads in a text file, parses it, and puts the result into a staging database table. The code looks like this:

     

    Imports System.Data.OleDb
    Imports System.Data.OleDb.OleDbType

     

     

    For Each row In table.Rows
                        With CurrentValueBuffer
                            .AddRow()

     

                            .CUSIP = CType(row("CUSIP"), String).TrimEnd()

     

                            If IsNumeric(row("RETURNCODE")) Then
                                .RETURNCODE = CType(row("RETURNCODE"), Int16)
                            End If

     

                            If IsNumeric(row("CPN")) Then
                                .CPN = CType(row("CPN"), Decimal)
                            End If

                           
                            If IsDate(row("CPN_ASOF_DT")) Then
                                .CPNASOFDT = CType(row("CPN_ASOF_DT"), Date)
                            End If

     

    (a bunch more code like this)

     

    It also has some functions to parse the file and turn it into a OleDb DataTable, although I am guessing that the error is in the code above. It is hard to tell since I don't know what line is causing the error and there are 330 lines in the script. Unfortunately our 64-bit server is the production server, so this is a bit hard to troubleshoot.

    Wednesday, December 19, 2007 3:04 PM
  • I should clarify that the script component doesn't insert into a staging database table, it outputs rows to the next step and the next step inserts into a staging table.

    Wednesday, December 19, 2007 3:08 PM
  •  usp wrote:

    Sure. It is a script component in a data flow that reads in a text file, parses it, and puts the result into a staging database table. The code looks like this:

     


     

    It also has some functions to parse the file and turn it into a OleDb DataTable, although I am guessing that the error is in the code above. It is hard to tell since I don't know what line is causing the error and there are 330 lines in the script. Unfortunately our 64-bit server is the production server, so this is a bit hard to troubleshoot.



    Why are you using a DataTable?
    Wednesday, December 19, 2007 3:18 PM
    Moderator
  •  

    The DataTable is a temporary structure to hold data as I loop over it. I parse data contained in a text file into a DataTable and then loop over the DataTable to create the output rows of the script component. This is necessary since I cannot directly output a DataTable from a script component. I have to specify exactly what columns are output as well as the data types. It would be nice if I could output the DataTable directly and skip the looping step.
    Wednesday, December 19, 2007 4:10 PM
  • This is the line of code causing the error:

     

    If IsNumeric(row("CPN")) Then
     .CPN = CType(row("CPN"), Decimal)
    End If

     

    Now I just need to determine why this doesn't work in the 64-bit environment

    Wednesday, December 19, 2007 5:37 PM
  • It turned out that this error had nothing to do with moving to 64 bit at all. It just happed that the first invalid data point ever detected in the field in question was inserted on the same day we moved to 64 bit.

    Wednesday, December 19, 2007 6:15 PM
  • Hi, i have the same error. What happened? What you solved this error?

    Thank


    Adixon

    Thursday, May 16, 2019 7:34 PM
  • Hi adix_alex,

    This post is too old, circa 2007. So nobody from the past will be able to help you.

    Please open a new post.

    Thursday, May 16, 2019 7:39 PM