Rebuild indexes on all tables in the database

It is recommended to rebuild the index when the business is idle;

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324482574&siteId=291194637