Stored Procedures  «Prev  Next»

Lesson 4Creating stored procedures, part 1
Objective Understand how to create a user-defined stored procedure.

Creating Stored Procedures in SQL-Server

You can use either Enterprise Manager or Transact-SQL to create a stored procedure.

Using Enterprise Manager

To create a stored procedure with Enterprise Manager:
  1. Drill down to the Stored Procedures folder.
  2. Right-click the Stored Procedures folder.
  3. Choose the New Stored Procedure menu option.
  4. Enter the appropriate Transact-SQL statements in the Stored Procedure Properties dialog box, shown below:

Creating a new stored procedure

As with triggers, you will need to use Transact-SQL within Enterprise Manager to create and modify stored procedures.

Using Transact-SQL

To create a stored procedure using Transact-SQL, you will use the CREATE PROCEDURE statement, which uses the syntax shown in the following SlideShow:

In the next lesson, you will practice creating a user-defined stored procedure.