Home Forums SQL Server 2005 Development How to get a row number which is failing during conversion RE: How to get a row number which is failing during conversion

  • The error is because you need to specify your decimal better. When your looking at the decimal data type it is decimal(TotalPositions, RoundToThe) which is probably causing your issue. So if you had an int of 1334 and specified decimal(4, 2) well you will get an arithmetic overflow error because you forgot to add spaces for the .xx so your decimal should have been decimal(7,2). Hopefully that makes sense if you just increase your decimal corrector position you won't get that error. Good luck!

    declare @num1 int = 1334

    --select cast(@num1 as decimal(4, 2)) --This will give an error on your

    select cast(@num1 as decimal(7, 2)) -- This has correct number of positions to hold