You can use this script to generate SQL commands to rebuild all of the indexes on all of the tables in the currently selected database.

SELECT 'ALTER INDEX ALL ON ' + t.[TABLE_NAME] + ' REBUILD; '
  FROM INFORMATION_SCHEMA.TABLES t
 WHERE t.[TABLE_TYPE] = 'BASE TABLE'
 ORDER BY t.[TABLE_NAME];