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

How does index makes search faster?

595


What do I need to start working with sql studio? : sql server management studio

588


Find first and last day of current month in sql server

595


Define outer join in sql server joins?

519


What is the difference between indexing and hashing?

542






What to check if a User database is locked?

584


after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?

1683


Explain external key management in sql server 2008

500


What is scd (slowly changing dimension)? : sql server analysis services, ssas

590


How can we migrate from SQL server to SQL Azure?

92


Is oracle faster than sql server?

549


Do you think BCNF is better than 2NF & 3NF? Why?

782


Do you know what are the restrictions applicable while creating views? : SQL Server Architecture

552


What is db stored procedure?

465


Give me a SQL Query to find out the second largest company?

688