I keep getting this error message everytime I run this query:
Msg 8115, Level 16, State 8, Line 33 Arithmetic overflow error converting numeric to data type
Use TRY_CAST function in exact same way of CAST function. TRY_CAST takes a string and tries to cast it to a data type specified after the AS keyword. If the conversion fails, TRY_CAST returns a NULL instead of failing.