• I found this useful bit of code :

    Run the following script changing the xxx for the database name, run against master.

    SELECT 'dbcc dbreindex(''xxxxxxx.DBO.' +name+ ''')'

    FROM sysobjects WHERE xtype='U'

    This will generate a rebuild statement for each index, copy the output from the results window and paste it to the QueryAnalyzer window and run against the right database. This can obviously be repeated for each database as required.