Saturday, October 6, 2007 11:07 AM
xmldeveloper
SQL Internals Viewer
If you need to see the physical structure of your database you can use DBCC PAGE as described here:Read Index Structure
[quote]
CREATE TABLE #DBCCIND(
PageFID INT,
PagePID INT,
IAMFID INT,
IAMPID INT,
ObjectID INT,
IndexID INT,
PartitionNumber INT,
PartitionID BIGINT,
iam_chain_type VARCHAR(100),
PageType INT,
IndexLevel INT,
NextPageFID INT,
NextPagePID INT,
PrevPageFID INT,
PrevPagePID INT);
INSERT INTO #DBCCIND
EXEC ('DBCC IND(''AdventureWorks'', ''Sales.SalesOrderHeader'',-1)');
WITH LinkedList AS
( SELECT 1 AS RowNum, PageFID, PagePID FROM #DBCCIND WHERE IndexID
= 1 -- specify index id here
AND IndexLevel = 0
AND PrevPageFID = 0
AND PrevPagePID = 0
UNION ALL
SELECT PrevLevel.RowNum + 1,
CurLevel.PageFID, CurLevel.PagePID FROM LinkedList AS PrevLevel
JOIN #DBCCIND AS CurLevel
ON CurLevel.PrevPageFID = PrevLevel.PageFID
AND CurLevel.PrevPagePID = PrevLevel.PagePID )
SELECT
CAST(PageFID AS VARCHAR(MAX)) + ':'
+ CAST(PagePID AS VARCHAR(MAX)) + ' ' AS [text()] FROM LinkedList
ORDER BY RowNum FOR XML PATH('') OPTION (MAXRECURSION 0);
DROP TABLE #DBCCIND;
[/quote]
Or better, you can use this great tool: SQL Internals Viewer
