select RIGHT('0000'+CAST( '123' AS nvarchar(50)),4) select right('00000000'+'123',8) 转载于:https://www.cnblogs.com/zhanghai/p/4452991.html