

This metadata enables the client-side APIs to implement updatable client-side cursors. Browse-mode metadata is additional metadata that the instance of SQL Server returns to these client-side APIs. Specifies that the instance of SQL Server will return to the DB-Library, ODBC, and OLE DB APIs the metadata information about the view, instead of the base table or tables, when browse-mode metadata is being requested for a query that references the view. For more information, see T-SQL views with dedicated SQL pool and serverless SQL pool in Azure Synapse Analytics. In Azure Synapse Analytics, views currently do not support schema binding. Also, executing ALTER TABLE statements on tables that participate in views that have schema binding fail when these statements affect the view definition. Otherwise, the Database Engine raises an error.

Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unless that view is dropped or changed so that it no longer has schema binding. All referenced objects must be in the same database. object) of tables, views, or user-defined functions that are referenced. When you use SCHEMABINDING, the select_statement must include the two-part names ( schema. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. SCHEMABINDINGīinds the view to the schema of the underlying table or tables. Using WITH ENCRYPTION prevents the view from being published as part of SQL Server replication. ENCRYPTIONĪpplies to: SQL Server 2008 (10.0.x) and later and Azure SQL Database.Įncrypts the entries in sys.syscomments that contain the text of the CREATE VIEW statement. It has no applicability to any updates performed directly to a view's underlying tables. The CHECK OPTION only applies to updates made through the view. The SELECT clauses in a view definition cannot include the following:Īn ORDER BY clause, unless there is also a TOP clause in the select list of the SELECT statement In an indexed view definition, the SELECT statement must be a single table statement or a multitable JOIN with optional aggregation. A view can be created that uses more than one table or other views with a SELECT clause of any complexity. Appropriate permissions are required to select from the objects referenced in the SELECT clause of the view that is created.Ī view does not have to be a simple subset of the rows and columns of one particular table. The statement can use more than one table and other views. Is the SELECT statement that defines the view. Specifies the actions the view is to perform. For example, if permissions are granted on the SalesOrderID column in a CREATE VIEW statement, an ALTER VIEW statement can name the SalesOrderID column with a different column name, such as OrderRef, and still have the permissions associated with the view using SalesOrderID. In the columns for the view, the permissions for a column name apply across a CREATE VIEW or ALTER VIEW statement, regardless of the source of the underlying data. Syntax for Azure Synapse Analytics and Parallel Data Warehouse and Microsoft FabricĬREATE VIEW view_name ) ] Transact-SQL syntax conventions Syntax - Syntax for SQL Server and Azure SQL DatabaseĬREATE VIEW view_name ) ]

To provide a backward compatible interface to emulate a table whose schema has changed. To focus, simplify, and customize the perception each user has of the database.Īs a security mechanism by allowing users to access data through the view, without granting the users permissions to directly access the underlying base tables. For example, a view can be used for the following purposes: Use this statement to create a view of the data in one or more tables in the database.

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL Endpoint in Microsoft Fabric Warehouse in Microsoft FabricĬreates a virtual table whose contents (columns and rows) are defined by a query.
