sql 左侧补0

right('0000000'+ CAST(SMID as NVARCHAR),7)

原文地址:https://www.cnblogs.com/liangyuwen/p/13518619.html