The DBCC REINDEX command has no effect on a heap table.
You can use one of three methods to rebuild a heap. ( a table without a clustered index.)
With the first method, you drop the nonclustered indexes and create a clustered index to order the data the way you want it. Then, you drop the clustered index and recreate the non-clustered indexes. With the second method, you use SELECT..INTO to make a copy of the heap, then either use sp_rename and reset your permissions to make the copy the primary heap table or truncate the table and use INSERT..SELECT to reinsert the data. The third method requires that you use BCP –N OUT (or another export method such as Data Transformation Services—DTS) to copy the data out of SQL Server, then truncate and reload the data.
- Paul
- If at first you don't succeed, find out if the loser gets anything.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.