0
SELECT 
    TradeId,
    Trade_SecurityId,
    SecurityType.*, 
    Trade_ParAmount Quantity 
INTO 
    #Securities 
FROM 
    Fireball.dbo.PreAssignSecurityType SecurityType
INNER JOIN 
    Fireball_RawImportData.dbo.Import_WSO_TradeReport TradeReport ON 
        SecurityType.NativeTradeId = TradeReport.Trade_ID AND
        TradeReport.Trade_TradeDate = SecurityType.TradeDate
INNER JOIN
    Fireball..Trade ON
        Trade.NativeTradeId = SecurityType.NativeTradeID
WHERE 
    SecurityType.TradeDate = '2012-02-02'

after that

INSERT INTO 
    Fireball..IRPTrade 
    (TradeId, Par, TradeFee, AccruedInterest, AccruedPIK, AccruedFees)
SELECT 
    TradeId, 
    Par, 
    TradeFee, 
    AccruedInterest, 
    AccruedPIK, 
    AccruedFees 
FROM 
    Fireball..bondTrade 
WHERE 
    TradeId IN 
    (
    SELECT 
        TradeId 
    FROM 
        #Securities 
    WHERE 
        SecurityType = 'IRP' OR 
        SecurityType = 'IRS'
    ) AND
    NOT EXISTS(
        SELECT  *
        FROM -- GETTING ERROR AT THIS LINE WHY :(
        Fireball..IRPTrade
    WHERE
        TradeId = bondTrade.TradeId)

Table definitions:

BondTradeId int Unchecked
TradeId int Unchecked
Par decimal(32, 4)  Checked
TradeFee    decimal(32, 4)  Checked
AccruedInterest decimal(32, 4)  Checked
AccruedPIK  decimal(32, 4)  Checked
AccruedFees decimal(32, 4)  Checked
        Unchecked

IRPTradeId  int Unchecked
TradeId int Unchecked
Par decimal(32, 4)  Checked
TradeFee    decimal(32, 4)  Checked
AccruedInterest decimal(32, 4)  Checked
AccruedPIK  decimal(32, 4)  Checked
AccruedFees decimal(32, 4)  Checked
        Unchecked

Might be one of the column value get exceeds decimal(32,4) from table Fireball..IRPTrade , Fireball..bondTrade?

4
  • Arithmetic overflow error converting numeric to data type numeric Commented May 9, 2012 at 14:47
  • can you post the datatypes of the columns in the tables near the error? Or post the table defs for each table? Commented May 9, 2012 at 14:55
  • OK i will update other coulmns are decimal(32,4) may be value gets exceeds bcoz of that getting error? Commented May 9, 2012 at 15:05
  • @Siva I have updated my question with datatypes plz help me. Commented May 9, 2012 at 15:11

2 Answers 2

1

Last time I got a similar error was because one of the value in a numeric field was set to NaN, not a number, corrected the value or deleted the row, was fine after that.

Sign up to request clarification or add additional context in comments.

Comments

1

Without the definitions of the table it's hard to answer :) Based on the error message it's most likely an error raised during the INSERT because data from a VARCHAR column cannot be correctly converted to an INT column.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.