SQL 清理缓存 更新无效

时间:2024-07-20 23:03:32
--查询结果1
select * from Student where ID='CCB87B71-FB78-4BFE-8692-24DD2D8F8460' --查询结果2
update Student set Age=35 where ID='CCB87B71-FB78-4BFE-8692-24DD2D8F8460'
select * from Student where ID='CCB87B71-FB78-4BFE-8692-24DD2D8F8460' --查询结果3
dbcc dropcleanbuffers ---清空所有缓存
dbcc freeproccache --清空存储过程缓存
dbcc freesessioncache --清空会话缓存
dbcc freesystemcache('all') --清空系统缓存 select * from Student where ID='CCB87B71-FB78-4BFE-8692-24DD2D8F8460'

未完待续,主要讲清除缓存后,更新无效,因为还没将更新写入到硬盘。