Updating Views

Remember that a view is a virtual table, and remember that when you submit a query against a view, SQL Server expands the view’s select statement and issues the query against the underlying tables. A view is not limited to being a target of SELECT queries; it can be a target for modifications, too. When you submit a modification against a view, SQL Server will modify the underlying tables. The view in such a case acts as an agent or a vehicle. Of course, you can limit the data that you’re exposing through the view by allowing modifications through the view but not directly against the underlying tables. This way, the view can play a security role to some degree in terms of privacy and disclosure.

For example, one way to achieve row-level ...

Get Inside Microsoft® SQL Server™ 2005 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.