Case Scenario: Validating Data Integrity


 

You are a database developer in your organization. Users are reporting that they find objects in the organization's customer relationship management (CRM) application whose parent objects have been deleted. One example is employees who work in a department that doesn't exist in the database. They also complain that prices for some products contain negative values, even though this should not be possible according to the documentation of the application. It is very important to find the source of these bugs as soon as possible, as well as to make sure that these issues do not reappear. Design a solution to solve this problem.

image from book

Answers

 

Implement foreign key constraints between child and parent objects (such as from employee to department) to stop parent objects from being deleted if they contain child objects. Implement a check constraint on the product price to validate that prices cannot be less than zero. After implementing these updates on a test environment, test the application against the test environment, and look for run-time errors caused by these added constraints.




MCITP Self-Paced Training Kit Exam 70-442  .Designing and Optimizing Data Access by Using Microsoft SQL Server 2005
MCITP Self-Paced Training Kit Exam 70-442 .Designing and Optimizing Data Access by Using Microsoft SQL Server 2005
ISBN: 073562383X
EAN: N/A
Year: 2007
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net