Chapter 3: First Stored Procedure

3.1 Introduction

In this chapter we dive right into developing a stored procedure. We take the process from requirements analysis, to table design, to creating a stored procedure which utilizes many aspects of typical procedures in complex sales databases.

The chapter covers the following topics:

Requirements Analysis

Creating Tables

Adding Test Data

Coding the Transact-SQL

Creating the Stored Procedure

Executing the Stored Procedure

Examining Procedures

Rules for Stored Procedure Creation

Input Parameters

Default Parameters

The Return Code

Output Parameters