MS SQL Tips & Tricks

How to reindex all tables in database

To reindex all tables in database You just need to execute script bellow:

EXEC [sp_MSforeachtable] @command1 = 
	"RAISERROR('DBCC DBREINDEX(''?'') ...',10,1) 
	WITH NOWAIT DBCC DBREINDEX('?')"

Learn more tricks

Add Comment

Comments