Arithmetic overflow in Procedure sp_MStran_ddlrepl

This was a fun error to encounter when I tried to alter one of my SQL Server views. I searched Google with some very limited results for this one.

Msg 8115, Level 16, State 2, Procedure sp_MStran_ddlrepl, Line 95

Arithmetic overflow error converting expression to data type tinyint.

It happened when I tried to alter an existing view. I was quite confused, because it didn’t happen on our dev box. It didn’t happen on our production box, either. It only happened on our server that has replication enabled. We don’t enable replication for views, so any alters I do have to also be executed on the replicated database.

We didn’t have a stored procedure named sp_MStran_ddlrepl, nor could I find it in the system stored procs. I wasn’t doing any conversions of any kind in the view. So, what didn’t it like?

An innocuous tab character. It was hiding.

ALTER VIEW [FOO]

It was hiding between the word VIEW and the bracket [. When I removed it and put a space there instead, all was magically well again with the world.

I hope this helps someone else, but I still don’t truly understand why it happened. If you can help explain why, I’d really appreciate the comment. Thanks!

Leave a Reply