Following errors can happen when any field in the database is attempted to insert or update larger data of the same type or other data type.
Msg 8115, LEVEL 16, State 2, Line 2 Arithmetic overflow error converting expression TO data type <ANY DataType>
Example is if integer 111111 is attempted to insert in TINYINT data type it will throw above error, as well as if integer 11111 is attempted to insert in VARCHAR(2) data type it will throw above error.
Fix/Solution/Workaround:
1) Verify the inserted/updated value that it is of correct length and data type.
2) If inserted/updated value are correct modify the definition of the table to accommodated new data type length.
Reference : Pinal Dave (http://blog.SQLAuthority.com)




In my case the fields are numeric with a comma: 99999,99 before change and 99999,9999 after change using a alter table.
I get sqlcode 8115 on it.
Do you now how I can realize this?
Yours truly,
Willem van Loon
I used ‘alter table XXX alter column XXX decimal (5,4) not null’ in SQL Server.
I am inserting into a temp table by doing
select col1,col2,col3,…… into #t
select avg(col1) as ave from #t
I still get this error.