SQL Server: Insert/Update/Delete in VIEW table

When I was conducting interviews for SQL candidates having 1-2 years of experience, most of them had misunderstanding about SQL VIEW tables and answered me as "VIEW table is created from BASE tables and thus VIEW is a virtual table where we cant do any edits on VIEW tables". When I say we can do UPDATE/INSERT/DELETE operations on VIEW tables, they wonder and not ready to accept it. This is incorrect.

"we can perform DML operations like UPDATE/INSERT/DELETE on VIEW tables."

Note
UPDATE, DELETE, INSERTS cannot be performed when the VIEW involves constraints in it

No comments:

Post a Comment