Your company stores its business information in a SQL Server database. To facilitate the order-entry process, you want to create a view that presents only those columns in the SALES table that are requires by the sales representatives when they take an order or modify customer information. Each sales representative is assigned a separate territory that includes a distinct set of customers. How can you ensure that each sales representative can only modify information about customers who reside in that representative’s territory?

Your company stores its business information in a SQL Server database. To facilitate the order-entry process, you want to create a view that presents only those columns in the SALES table that are requires by the sales representatives when they take an order or modify customer information. Each sales representative is assigned a separate territory that includes a distinct set of customers. How can you ensure that each sales representative can only modify information about customers who reside in that representative’s territory?


Answer – Create a separate view on the SALES table for each territory and specify WITH CHECK OPTION.

(Forces all data modification statements executed against the view to follow the criteria set within select_statement. When a row is modified through a view, the WITH CHECK OPTION makes sure the data remains visible through the view after the modification is committed.)