日期:2014-05-18 浏览次数:20815 次
--原始数据:@ta declare @ta table(id int,bh varchar(20)) insert @ta select 1,'aaa1234' union all select 2,'bb12345' union all select 3,'c999c09' update @ta set bh=reverse(stuff(reverse(bh),patindex('%[a-z]%',reverse(bh)),0,'000')) select * from @ta /* id bh ----------- -------------------- 1 aaa0001234 2 bb00012345 3 c999c00009 */