What is WITH CHECK OPTION

Answers were Sorted based on User's Feedback



What is WITH CHECK OPTION..

Answer / guest

When you use this option to create a view with a where
condition, the system wont allow to perform any action which
will invalidate the definition of the view.

ex:
create view test
as
select firstname,lastname from Employees where sal<10000
with Check option

If this returns 10 rows when you are updating the view if
any action is being done which updates the sal so that the
view returns lesser number of records is not allowed.

Is This Answer Correct ?    5 Yes 0 No

What is WITH CHECK OPTION..

Answer / 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

What is WITH CHECK OPTION..

Answer / naren

The CHECKPOINT statement saves time in a subsequent
recovery by creating a point at which all modifications to
data and log pages are guaranteed to have been written to
disk.

Checkpoints also occur:

When a database option is changed with ALTER DATABASE. A
checkpoint is executed in the database in which the option
is changed.


When a server is stopped, a checkpoint is executed in each
database on the server. These methods of stopping Microsoft
SQL Server 2000 checkpoint each database

Is This Answer Correct ?    4 Yes 8 No

Post New Answer

More SQL Server Interview Questions

If there exist a index on the table, and we then make a view on that table (include the indexed column from base table) than why do we require indexing on view?Doesnt it create an overhead?

2 Answers  


What is data mart? : sql server analysis services, ssas

0 Answers  


What is a cursor in SQL Server 2000 and their types?

8 Answers  


how to get rank of diffrent student in same table based on newly inserted row in sql server2008

4 Answers   ABC,


What is the new security features added in sql server 2016? : sql server security

0 Answers  






ehat is the default port no of sql 2000?

2 Answers   IBM,


Diffrences between sql server 2000 vs 2005

2 Answers   Thomson Reuters,


How to select nth record from a table?

13 Answers   DELL, Microsoft, Ramco,


What is the difference between join and inner join?

0 Answers  


Your company has 50 branches all over the country all the branches, including the head office have sql server as the database every night all 50 branches upload certain information to the head office which replication topology is best suited for the above scenario?

0 Answers  


How to Execute an Operating System Command From Within SQL Server ?

3 Answers  


write the query for taking database restore in sql?

2 Answers  


Categories