How to determine which row in a table a LOB Page is connected to?

John Couch 181 Reputation points
2024-03-12T21:15:51.3066667+00:00

I have a table with Lob Data Pages, using DBCC IND and DBCC PAGE to look at a page, I am curious if there is a way to determine which record in the table the data on that page is tied too?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,203 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
62 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Greg Low 1,670 Reputation points Microsoft Regional Director
    2024-03-13T03:29:12.38+00:00

    It's described quite well here: https://sqlity.net/en/2496/text-mix-page/

    In that article, he uses sys.dm_db_database_page_allocations (undocumented) to get a list of pages for the allocation units for a table.

    Keep in mind that LOB pages are now often "overflow" pages and there may be multiple, even for a single column in the source table. DBCC PAGE for these shows the slot number and offset for the data on the page.

    There is also a pretty good article here that shows how to wander through using DBCC IND and DBCC PAGE: https://www.sqlservercentral.com/articles/understanding-the-internals-of-a-data-page#:~:text=LOB%20(Large%20OBject)%20page,depending%20on%20the%20column%20size.