Sql server updating data in a view dating service industry statistics
ENCRYPTION Applies to: SQL Server 2008 through SQL Server 2017 and Azure SQL Database.
Encrypts the entries in sys.syscomments that contain the text of the ALTER VIEW statement.
This causes the advantages of views to become muddled and misunderstood.
As you read this article you will find that views are very useful when implemented wisely, but can be an administrative burden if implemented without planning.
Furthermore, views are simple to create and implement.
But unfortunately most users do not adhere to a systematic and logical approach to view creation.
Restrictions on Updating Data Through Views You can insert, update, and delete rows in a view, subject to the following limitations: If the view contains joins between multiple tables, you can only insert and update one table in the view, and you can't delete rows.
You can't directly modify data in views based on union queries.
A view is basically the relational model's way of turning a SELECT statement into a "table" that is accessible using SQL. They can consist of any combination of the following: Views are defined using SQL and are represented internally to SQL Server by a SELECT statement, not by stored data.
The SQL UPDATE VIEW command can be used to modify the data of a view.
An updatable view is one which allows performing a UPDATE command on itself without affecting any other table. The view is defined based on one and only one table. The view must include the PRIMARY KEY of the table based upon which the view has been created. The view should not have any field made out of aggregate functions. The view must not have any DISTINCT clause in its definition. The view must not have any GROUP BY or HAVING clause in its definition. The view must not have any SUBQUERIES in its definitions. If the view you want to update is based upon another view, the later should be updatable. Any of the selected output fields (of the view) must not use constants, strings or value expressions.
Does this mean that I can only update fields in dbo.
Staff (which is all I can currently achieve) In this context does the definition of 'base table' not extend to any subsequently joined tables?