Thanks all for your suggestions. Here's the actual spec. Forgive me if it might seem a little vague, but really i'm a developer, and not an expert on the hardware...
Don't mean to be picky but have you thought of using the INFORMATION_SCHEMA.TABLES view to get the tables listing? This is based upon the sysobjects table but is the preferred...
The data warehouse that i work on is defragmented weekly, rather than having the indexes rebuilt. The reason for this is that calling DBCC INDEXDEFRAG produces less locking than DBCC...
If you are thinking of running this script from a job, or within a stored procedure then you might want to think about bcp. Check out BOL for exact syntax.