重建数据库所有表的索引

建议在业务空闲的时间,进行索引重建工作;

declare @sql varchar(max)
set @sql=''
select @sql=@sql+'dbcc dbreindex('+name+');' from sys.tables where name not like 'tm%'
print @sql
exec(@sql)

猜你喜欢

转载自blog.51cto.com/yataigp/2104242