Thread: ObjID in Page Header
12-09-15, 03:22 #1Registered User
- Join Date
- Apr 2013
Unanswered: ObjID in Page Header
I am reading the article at http://www.sqlskills.com/blogs/paul/...omy-of-a-page/
I have a database ‘MyDB’, and there is a table ‘MyTable’ in the database.
I have the following questions:
1. If I do as follows:
(1) use the following query to find the object ID for a table:
select sys.objects.name, sys.objects.object_id from sys.objects where (name = ‘MyTable’);
(2) then use the following command to find all pages allocated to ‘MyTable’:
dbcc ind(MyDB, 'MyTable', -1);
(3) then in the result table, I choose one of the data pages(page type = 1), and use the following command:
DBCC PAGE (MyDB, 1, 17386, 3);
Then in the dumped content(page header) of step (3), the m_objId (AllocUnitId.idObj) field should equal to the object ID obtained in step (1). Is that correct?
And whether that works for both user tables and system base tables, such as ‘sys.syscolpars’ base table?
Based on my test, the above two conclusion are both correct.
2. What is the meaning of Metadata: ObjectId? In article http://www.sqlskills.com/blogs/paul/...omy-of-a-page/, the ‘metadata: objectId’ <> ‘m_objId’. But from my own tests, the ‘metadata: objectId’ always equals to ‘m_objId’. Why? The original article does not explain the metadata clearly.
I am using SQL Server 2005, 2008, 2008R2, 2012 and 2014