Rebuilding a databases data

  • Hi,

    I am familiar with setting and rebuilding indexes in SQL Server 2000, but I have been asked to investigate how to rebuild the data in a database.

    We have a table that contains an large amount of data. Several new columns have been added to this table and my boss says I will need to rebuild the data as well as the indexes so that it is stored contiguously instead of being scattered all over the place.

    I've had a look through books online and can only come up with references to rebuilding the master database.

    Can anyone point me in the right direction?

    Thanks for your time.

    Regards,

    Kevin.

    Windows 2008 Server | SQL Server 2008

  • I think if you restore it from a backup it will be contiguous. The question will be, is this feasible.

    Chris

  • I think the easiest way to rebuild the data would be to delete and add a clustered index.  The final result would be data ordered by the clustered index.

  • Thanks guys.

    Windows 2008 Server | SQL Server 2008

  • Also, you can use Bulk Export/Import queries on each table and reload all the data.  It's amazing how fast bulk operations are.



    Mark

  • It sounds like you boss is talking about DBCC INDEXDEFRAG and DBCC DBREINDEX commands. Check them out in the Books OnLine. -SQLBill

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply