REFRESH TABLE
描述
REFRESH TABLE
语句使给定表或视图的缓存条目(包括数据和元数据)失效。失效的缓存会在再次执行缓存表或与其关联的查询时以惰性方式填充。
语法
REFRESH [TABLE] table_identifier
参数
-
table_identifier
指定一个表名,它是一个限定名或非限定名,用于指定表/视图。 如果未提供数据库标识符,则它指的是当前数据库中的临时视图或表/视图。
语法:
[ database_name. ] table_name
示例
-- 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;