Reindex a Database

This simple script is used reindex a database.

Suitable For:

2000, 2005, 2008

Download/Script:

Reindex_database.zip

-- Reindex database.sql
-- Fillfactor is 0 which uses the fill factor value last specified for the index.

USE database?
GO

EXEC [sp_MSforeachtable] @command1="DBCC DBREINDEX('?', '', 0)"
GO

EXEC sp_updatestats
GO