Eric M Russell (12/7/2016)
alex.sqldba (12/7/2016)
Hi Eric,Whilst it is not a heap, there is a clustered index on a datetime field, I am curious as to how one would go about reclaiming the space if it was in fact a heap?
Would you have to add a clustered index to deal with it?
This will rebuild table and indexes in one atomic operation.
ALTER TABLE <TableName> REBUILD;
I could be wrong but the documentation on ALTER TABLE leads me to believe that it will either rebuild a HEAP or just the Clustered Index on a table and that it won't actually rebuild the Non-Clustered Indexes. Haven't actually tried it, though, so can't say for sure.
--Jeff Moden
Change is inevitable... Change for the better is not.