I have a table without a clustered index in SQL Server 2008R2 Standard with a lot of unused space, as shown in the following image:
How do I reclaim unused space from MyTable
?
Said table is declared as follows:
CREATE TABLE [dbo].[MyTable](
[RecordID] [varchar](50) NULL,
[DocumentID] [nvarchar](100) NULL,
[DocumentName] [varchar](100) NULL,
[DocumentOwner] [varchar](50) NULL,
[DocumentTemplate] [varchar](50) NULL,
[DocumentData] [ntext] NULL,
[DocumentDate] [char](10) NULL,
[DocumentTime] [char](10) NULL,
[DocumentSize] [int] NULL,
[DocumentUpdateVersion] [int] NULL,
[SecondaryStorageURI] [varchar](150) NULL,
[PreviousExportUri] [varchar](150) NULL
)
What steps should I follow to free unused space?
Best Answer
If your table doesn't have a clustered index, then deletes don't deallocate empty pages by default.
Your options are: