Reindexing in this fashion should not be done during production hours, as the db in question will be locked while the operation takes place.
USE [your database name]
DECLARE @TableName varchar(255)
DECLARE TableCursor CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN PRINT 'Now reindexing ' + @TableName
DBCC DBREINDEX(@TableName,' ',90)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
Once the operation is complete, you can review the output pane to see if errors occurred when reindexing the various tables in the db. Such errors will typically appear between the "Now reindexing" statement and the "DBCC Execution Completed" statement that corresponds to a given table.