Validating data is one of the most basic tasks in software development. As a result, validation routines tend to be spread all over the application architecture. You are likely to find data validation in the following technologies:
Microsoft Windows Forms applications
ASP.NET pages
JavaScript embedded in HTML
Business components (such as .NET library assemblies or COM components)
Databases
Often, there are too few validation routines in the database because many developers trust the validation that is done before the data actually arrives in the database. This chapter covers what type of validation you can perform in the database and how you can implement it, as well as the key aspects of error handling and how to send messages back to the calling application. All examples in this chapter reference objects in a schema called Test. You can create this schema simply by executing the statement "CREATE SCHEMA Test;".
Exam objectives in this chapter:
Design code that validates input data and permissions.
Design code that detects and reacts to errors.
Design user-defined messages to communicate application events.