这个语句总是报错:Arithmetic overflow error converting varchar to data type numeric.
declare @li_days decimal(4,0),
@table_name char(12),
@user_code char(9)
EXEC('update '+@table_name+'
set gz_sbxz=(case
when salary_type=''C'' then cast((low_salary+gz_zgjt+gz_jsjt+gz_zwjt+gz_tzx)*day_number as decimal(4,0))
when salary_type=''B'' then cast((low_salary+gz_zgjt+gz_jsjt+gz_zwjt+gz_tzx) as decimal(4,0))
else
cast((low_salary+gz_zgjt+gz_jsjt+gz_zwjt+gz_tzx)*day_number/'''+@li_days+''' as decimal(4,0))
end)
from set_right_dept_dbf
where set_right_dept_dbf.dept_code='+@table_name+'.dept_code and
set_right_dept_dbf.if_enabled=''T'' and
set_right_dept_dbf.work_code='''+@user_code+''' ')