刷新表

描述

REFRESH TABLE 语句会使给定表或视图的缓存条目失效,包括数据和元数据。 当再次执行缓存表或与其关联的查询时,失效的缓存将以惰性方式填充。

语法

REFRESH [TABLE] table_identifier

参数

示例

-- The cached entries of the table will be refreshed  
-- The table is resolved from the current database as the table name is unqualified.
REFRESH TABLE tbl1;

-- The cached entries of the view will be refreshed or invalidated
-- The view is resolved from tempDB database, as the view name is qualified.
REFRESH TABLE tempDB.view1;