IF Object_id('T1') is NOT NULL
DROP TABLE T1
Go
CREATE TABLE T1(Name varchar(20))
Go
INSERT T1 (Name) values ('Apple'),('Boy'), ('Dog'),('Elephant')
GO
SELECT * From T1
CREATE CLUSTERED INDEX CINDX_T1 ON T1(NAME)
/*
1 – data page
2 – index page
3 and 4 – text pages
8 – GAM page
9 – SGAM page
10 – IAM page
11 – PFS page
*/
DBCC IND('SQLCommitted',T1,-1)
/*
dbcc page ( {‘dbname’ | dbid}, filenum, pagenum [, printopt={0|1|2|3} ])
*/
DBCC TRACEON (3604);
DBCC PAGE ('SQLCommitted', 1,668, 1)
INSERT T1 (Name) values ('Cat')
DBCC PAGE ('SQLCommitted', 1,664, 1)
DBCC PAGE ('SQLCommitted', 1,664, 2)
ALTER TABLE T1 REBUILD
DBCC IND('SQLCommitted',T1,-1)
DBCC PAGE ('SQLCommitted', 1,664, 1)
DBCC PAGE ('SQLCommitted', 1,664, 2)
DROP TABLE T1
Go
CREATE TABLE T1(Name varchar(20))
Go
INSERT T1 (Name) values ('Apple'),('Boy'), ('Dog'),('Elephant')
GO
SELECT * From T1
CREATE CLUSTERED INDEX CINDX_T1 ON T1(NAME)
/*
1 – data page
2 – index page
3 and 4 – text pages
8 – GAM page
9 – SGAM page
10 – IAM page
11 – PFS page
*/
DBCC IND('SQLCommitted',T1,-1)
/*
dbcc page ( {‘dbname’ | dbid}, filenum, pagenum [, printopt={0|1|2|3} ])
*/
DBCC TRACEON (3604);
DBCC PAGE ('SQLCommitted', 1,668, 1)
INSERT T1 (Name) values ('Cat')
DBCC PAGE ('SQLCommitted', 1,664, 1)
DBCC PAGE ('SQLCommitted', 1,664, 2)
ALTER TABLE T1 REBUILD
DBCC IND('SQLCommitted',T1,-1)
DBCC PAGE ('SQLCommitted', 1,664, 1)
DBCC PAGE ('SQLCommitted', 1,664, 2)
Comments
Post a Comment