REFRESH TABLE

Invalidates the cached entries, which include data and metadata of the given table or view. The invalidated cache is populated in lazy manner when the cached table or the query associated with it is executed again.

Syntax

REFRESH [TABLE] table_identifier

Parameters

  • table_identifier

    A table name, which is either a qualified or unqualified name that designates a table or view. If no database identifier is provided, it refers to a temporary view or a table or view in the current database.

    Syntax: [database_name.] table_name

Examples

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

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