Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 3.77 KB

alter-materialized-view-transact-sql.md

File metadata and controls

86 lines (67 loc) · 3.77 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
ALTER MATERIALIZED VIEW (Transact-SQL)
ALTER MATERIALIZED VIEW (Transact-SQL)
XiaoyuMSFT
xiaoyul
wiassaf
07/03/2019
sql
data-warehouse
reference
ALTER_VIEW_TSQL
ALTER VIEW
indexed views [SQL Server], modifying
views [SQL Server], modifying
modifying views
ALTER VIEW statement
TSQL
=azure-sqldw-latest

ALTER MATERIALIZED VIEW (Transact-SQL)

[!INCLUDE asa]

Modifies a previously created materialized view. ALTER VIEW does not affect dependent stored procedures or triggers and does not change permissions.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

ALTER MATERIALIZED VIEW [ schema_name . ] view_name
{
      REBUILD | DISABLE
}
[;]

Arguments

schema_name
Is the name of the schema to which the view belongs.

view_name
Is the materialized view to change.

REBUILD
Resumes the materialized view.

DISABLE
Suspends maintenance on the materialized view while maintaining metadata and permissions.  All queries against the materialized view while in a disabled state resolve against the underlying tables.

Permissions

ALTER permission on the table or view is required.

Examples

This example disables a materialized view and puts it in suspended mode.

ALTER MATERIALIZED VIEW My_Indexed_View DISABLE;  

This example resumes materialized view by rebuilding it.

ALTER MATERIALIZED VIEW My_Indexed_View REBUILD;  

See also

Performance tuning with Materialized View
CREATE MATERIALIZED VIEW AS SELECT (Transact-SQL)
EXPLAIN (Transact-SQL)
sys.pdw_materialized_view_column_distribution_properties (Transact-SQL)
sys.pdw_materialized_view_distribution_properties (Transact-SQL)
sys.pdw_materialized_view_mappings (Transact-SQL)
DBCC PDW_SHOWMATERIALIZEDVIEWOVERHEAD (Transact-SQL)
[[!INCLUDEssazuresynapse-md] and [!INCLUDEssPDW] Views](../../relational-databases/system-catalog-views/sql-data-warehouse-and-parallel-data-warehouse-catalog-views.md)
[System views supported in [!INCLUDEssazuresynapse-md]](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-system-views)
[T-SQL statements supported in [!INCLUDEssazuresynapse-md]](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-statements)