ViewsVIEWS:
• view is nothing but a logical representation based on one or more tables • A view can be thought of as either a virtual table or a stored query, like a real table, a view consists of a set of named columns and rows of data • The result set of the SELECT statement forms the virtual table returned by the view NEED FOR VIEWS: • Focus on specific data • Security • Simplify data manipulation • Customized perception • Combine partitioned data VIEW FEATURES: • Tables in more than one database • More than 1 server(in ss 2000) • On base tables or on views • No defaults,triggers,constraints • No temporary views • No views on temporary tables • orderby keyword not allowed view syntax: CREATE VIEW <view name> AS -- SELECT STATEMENT GO CREATE VIEW BR1CUSTOMERS AS SELECT * FROM AMASTER WHERE BRID='BR1' |
|