Menu
header photo

SQL-Talk

Talks all about SQL Server and Azure

SQL Server Database Pages Demo

--Pages Demo
--step1: Creating table
create table Books(bid int,bname varchar(40),qty int,price money)
--step2: Checking for pages
dbcc ind(0,'Books',-1)
--step3: Inserting sample data
insert Books values(1,'SQL',40,100),(2,'SQL Performance',40,120)
--Step4: Check for pages
dbcc ind(0,'Books',-1)
--step5: 
insert Books values(1,'SQL',40,100),(2,'SQL Performance',40,120)
go 10000
dbcc ind(0,'Books',-1)
--step6:
delete from Books
dbcc ind(0,'Books',-1)
--step7
truncate table Books
dbcc ind(0,'Books',-1) --0 pages
--step8: Index
insert Books values(1,'SQL',40,100),(2,'SQL Performance',40,120)
create nonclustered index indx1 on Books(bid)
dbcc ind(0,'Books',-1)
--step9: To view page contents
dbcc traceon(3604)
go
dbcc page(0,1,370,1)