What is WITH CHECK OPTION

Answer Posted / sanjeev kumar

CREATE VIEW Authorsview
AS
SELECT au_id, au_fname, au_lname, phone, state, contract
FROM authors
WHERE state = 'ca'

This is an updatable view and a user can change any column value
like:
UPDATE Authorsview SET state='NY'


Example: but when we create With Check Option then Same as
above but the state column cannot be changed.

CREATE VIEW Authorsview
AS
SELECT au_id, au_fname, au_lname, phone, state, contract
FROM authors
WHERE state = 'ca'
With Check Option

The view is still updatable, except for the state column:

UPDATE Authorsview SET state='NY'

This will cause an error and the state will not be changed
because we have use check option with state.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dml command?

553


What is the report model project?

103


What is a benefit of using an after insert trigger over using a before insert trigger?

521


Can a database be shrunk with users active?

607


Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?

546






How to define the name and server for a new dsn?

550


What is side by side migration in sql server?

545


What is the difference between the application object and session object?

602


What are the restrictions that views have to follow?

565


What is the difference between join and inner join?

541


What is a join in sql?

592


What is the default sql server instance name?

561


how many triggers you can have on a table? : Sql server database administration

499


How to override dml statements with triggers?

583


What is an sql server agent?

551