The following stript combines two previous articals. sp_MStablespace was being demonstrated with a cursor. To reduce the code the sp_MSforeachtable could be used.
When doing bulk data changes it may be beneficial to disable indexes prior to starting the operation. Fortunately, SQL's rich metadata makes this very easy to automate in a robust fashion.