select cast('020' as smallint) select convert(int,'020')
转为整形自动截取 declare @code varchar(10) set @code ='022' select cast('021' as int)