Chapter Summary


This chapter has covered two critical concepts for creating efficient database applications: stored procedures and user-defined functions. Stored procedures enable you to modularize frequently used queries and complex logic into an easy-to-manage database object. User -defined functions provide similar functionality, but with the additional capability to return single values or tables to the caller, which provides a great deal of flexibility.

KEY TERMS

  • ALTER

  • CREATE

  • deterministic

  • DROP

  • non-deterministic

  • SCHEMABINDING

  • stored procedure

  • user-defined function

Stored procedures and user-defined functions are critical to the success of any application from a management and performance perspective. They provide a clear line between what the application is responsible for and what the database is responsible for, with the capability to provide a clearly defined interface between application and data.

Both stored procedures and user-defined functions are used to filter data, enforce business rules, and manage how data is changed in a database. These are exam objectives, but they are also important concepts to understand if you are going to successfully write applications that use SQL Server. The philosophy behind both is simple: modularize code to reduce programming mistakes that result from having similar code repeated throughout an application. Stored procedures and user-defined functions are the building blocks of good, stable applications. That is why stored procedures and user-defined functions are on this exam.

The previous chapters all lead up to this chapter. The chapters on database design, query writing, and script writing all tie together here. Without an understanding of database design, you can't write good queries. Without an understanding of how queries and scripts are written, you can't write good stored procedures or user-defined functions.



MCSE Training Guide (70-229). Designing and Implementing Databases with MicrosoftR SQL ServerT 2000 Enterprise Edition
MCSE Training Guide (70-229). Designing and Implementing Databases with MicrosoftR SQL ServerT 2000 Enterprise Edition
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 228

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