Index all tables in one shot (2011-4-8)
Here’s a nice little snippet of T-SQL code that will reindex all tables in the database with one line of code: EXEC sp_msForEachTable @COMMAND1= ‘DBCC DBREINDEX ( “?”)’ Keep in mind that the DBCC DBREINDEX command will put a lock on the table while it does its thing, so you may not want to do [...]


