SQL Server / Forwarded Records / Rebuild the Heap Tables Script

SQL Server / Forwarded Records / Rebuild the Heap Tables Script
I was working with a customer having DB with more than 100K HEAP tables. Number of Forwarded Records on some tables were huge. They are using Ola Hallengren‘s scripts to maintain non-clustered indexes on those tables, but rebuilding those indexes do not fix the forwarded records on those HEAP tables. You actually need to rebuild the HEAP ALTER TABLE TableName REBUILD; Or to add a clustered index to the table (permanent fix). They are in the middle of the remodeling their DB so adding clustered indexes on those HEAP tables was not an option....
read more