中间补位:stuff('字段',开始位置,要截断的位数,'要插入几个') --起始位置值为1,要截断的位数为自然数
select stuff('123',2,0,'456') --起始位置值为1
select stuff('123',2,1,'456') --起始位置值为1
select stuff('123',2,2,'456') --起始位置值为1
select stuff('123',2,3,'456') --起始位置值为1
左侧补位:right('n个数字或字符'+ltrim('字符串'),位数n)
select right('0000'+ltrim('011'),4)
select right('aaaa'+ltrim('011'),4)
右侧补位:left(rtrim('字符串')+'n个数字或字符',位数n)
select left(rtrim('011')+'aaaa',4)
select left(rtrim('011')+'0000',4)