C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Views


Posted Date: 03 Nov 2009      Posted By: Christopher      Member Level: Gold     Points: 1   Responses: 3



hi

What is the use of 'WITH CHECK OPTION' in Views





Responses

Author: Neetu    03 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

WITH CHECK OPTION is an optional clause on the CREATE VIEW statement that specifies the level of checking to be done when inserting or updating data through a view. If the option is specified, every row that is inserted or updated through the view must conform to the definition of that view.

For More details refer this.
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/sqlp/rbafywcohdg.htm

regards
Neetu



Author: Venkatesh Kumar    03 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Hi,

WITH CHECK OPTION on a View:

WITH CHECK OPTION is an optional clause on the CREATE VIEW statement that specifies the level of checking to be done when inserting or updating data through a view. If the option is specified, every row that is inserted or updated through the view must conform to the definition of that view.

WITH CHECK OPTION cannot be specified if the view is read-only. The definition of the view must not include a subquery.

If the view is created without a WITH CHECK OPTION clause, insert and update operations that are performed on the view are not checked for conformance to the view definition. Some checking might still occur if the view is directly or indirectly dependent on another view that includes WITH CHECK OPTION. Because the definition of the view is not used, rows might be inserted or updated through the view that do not conform to the definition of the view. This means that the rows cannot be selected again using the view.

The checking can be on of the following:

* WITH CASCADED CHECK OPTION
* WITH LOCAL CHECK OPTION

Regards,
Venkatesh Kumar K.



Author: Shameer    03 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

WITH CHECK OPTION checks the condition specified on a column whenever you do an insert or update to that column data.

For example, if you have a column named salary and have specified a WITH CHECK constraint to check that salary should be greater than 2500, then whenever you do an insert or update, it will check for the validity of data in the salary column . i.e the salary column should always have a value > 2500.



Post Reply
You must Sign In to post a response.
Next : How to find the reason behind the Disk Space Growth in my sqlserver
Previous : Data Types
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use