Email me at this address if my answer is selected or commented on:Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
1 Answer
0 votes
Hi,
A view is simply a saved select statement. It does not contain data. When you call a view, it executes that select statement.
let's use this sample view as an example:
CREATE VIEW vw_customer
AS
BEGIN
SELECT * FROM customer
END
If you make a call to the view like this:
SELECT * FROM vw_customer
it's the same as if you are executing the following:
SELECT * FROM (SELECT * FROM CUSTOMER)
Another reason to create a view is to provide a layer of abstraction for the underlying table. This could be for security reasons, or to alias the columns, or to provide additional columns.