CAST格式化列数据前加0

update TableName
set ConsultantID=right(cast('1000000000'+CONVERT(int,ConsultantID) as varchar(10)),9)
原文地址:https://www.cnblogs.com/monkeyfather/p/3867879.html