Chapter 9. Views

for RuBoard

I want to personally thank all those who have doubted me in the past. All those who gave up on me, who thought little of me, who underestimated meyou have been a source of inspiration. You have caused me to work faster and try harder than I otherwise would have, an d, for that, I owe you a debt of gratitude.

H. W. Kenton

An SQL Server view object is a static query that you can use as a kind of virtual table in a SELECT, INSERT, UPDATE, or DELETE. A view consists of a SELECT statement stored permanently as a separate object using SQL's CREATE VIEW command. A view is typically used to encapsulate a complicated join or query so that it can be accessed like a table.

View columns can consist of columns from tables or other views, aggregates, constants, and expressions (computed columns ). Some views can be updated; some can't. Whether a view can be updated depends largely on whether SQL Server can resolve an update to one of its rows to a single row in an underlying base table. All views must eventually reference a base table or nontabular expression (an expression that doesn't require a tableGETDATE(), for example), although views can be "nested," meaning that a view can reference other views as long as the dependence tree eventually resolves to base tables or nontabular expressions.

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