|Lesson 4||Creating stored procedures, part 1 |
|Objective|| Understand how to create a user-defined stored procedure.|
Creating Stored Procedures
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:
- rill down to the Stored Procedures folder.
- Right-click the Stored Procedures folder.
- Choose the New Stored Procedure menu option.
- Enter the appropriate Transact-SQL statements in the Stored Procedure Properties dialog box, shown below:
As with triggers, you will need to use Transact-SQL within Enterprise Manager to create and modify stored procedures.
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.