Updatable Views

for RuBoard

As mentioned earlier, there are a number of factors that affect whether a view without an INSTEAD OF trigger is updatable. Because you control how updates occur with views that have INSTEAD OF triggers, these restrictions don't apply to them. Otherwise, for a view to allow updates, the following criteria must be met:

  • Aggregate functions, the TOP, GROUP BY, UNION, or DISTINCT clauses/keywords, are not allowed.

  • Derived columns ( columns constructed from complex expressions) cannot be updated.

  • SELECT lists consisting entirely of nontabular expressions are not allowed.

Again, the bottom line is that the server must be able to translate an update to a row in the view into an update to a row in a base table. If it can't do this, you can't update the view.

for RuBoard


The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
ISBN: 201700468
EAN: N/A
Year: 2005
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net