日期:2014-05-17 浏览次数:20502 次
declare @col varchar(15) set @col='5550087_C.abc' select left(@col,7)+substring(@col,9,1)
------解决方案--------------------
declare @sql varchar(8000) select @sql=isnull(@sql+char(10),'') +'exec sp_rename ''['+a.name+'].['+b.name+']'', '''+replace(replace(b.name,'_',''),'.abc','')+'''' from sysobjects a join syscolumns b on a.id=b.id where a.type='U' and b.name like '%.abc' exec (@sql)
------解决方案--------------------