Heaps have one row in sysindexes with indid = 0. The column sysindexes.FirstIAM points to the first IAM page in the chain of IAM pages that manage the space allocated to the heap. Microsoft® SQL Server™ uses the IAM pages to navigate through the heap. The data pages and the rows within them are not in any specific order, and are not linked together. The only logical connection between data pages is that recorded in the IAM pages.
Table scans or serial reads of a heap are done by scanning the IAMs to find the extents holding pages for the heap. Because the IAM represents extents in the same order they exist in the file, this means that serial heap scans progress uniformly down the file. A table scan on a heap works as follows:
This is more efficient than the data page chains in earlier versions of SQL Server where the data page chain often took a somewhat random path through the files of a database. It also means that the rows are not returned in the order in which they were inserted.