--step1: Creating table
create
table
books(bid int,bname varchar(40),qty
int)
--step2: inserting data
insert
into
books values(1,'SQL',450)
--step3: To check the pages
SELECT
Page_Status = CASE
WHEN
is_modified = 1 THEN
'Dirty'
ELSE 'Clean'
END,
DBName = CASE
WHEN
database_id = 32767 THEN
'RESOURCEDB'
ELSE DB_NAME(database_id)
END,
Pages = COUNT(1)
FROM
sys.dm_os_buffer_descriptors
WHERE
database_id = DB_ID()
GROUP
BY
database_id, is_modified
ORDER
BY
2
--step4: Checkpoing
checkpoint
--step5: Check the pages
again
SELECT
Page_Status = CASE
WHEN
is_modified = 1 THEN
'Dirty'
ELSE 'Clean'
END,
DBName = CASE
WHEN
database_id = 32767 THEN
'RESOURCEDB'
ELSE DB_NAME(database_id)
END,
Pages = COUNT(1)
FROM
sys.dm_os_buffer_descriptors
WHERE
database_id = DB_ID()
GROUP
BY
database_id, is_modified
ORDER
BY
2
No comments
Post a Comment
Note: Only a member of this blog may post a comment.