login

SQL Stored Procedure Tutorial

Introducing to Stored Procedure

Stored procedure by definition is a segment of code which contains declarative or procedural SQL statement.

Getting Started with Stored Procedure

You will learn how to write the first stored procedure and how to call it.

Parameter List in Stored Procedure

A stored procedure can have zero, one or more than one parameters. If a stored procedure has more than one parameter, each one must be separated by a comma.

Body Part of a Stored Procedure

The body part of a stored procedure is where you can put your business logic code inside to execute it as you want it to do.

Local Variables in Stored Procedure

Local variables are used in stored procedure to keep temporary intermediate results.

Common Usage Flow-Control in Stored Procedure

There are two most common usage of flow-control which are conditional execution and loop.

Modifying and Compiling Stored Procecdure

Once a store procedure is resided in the database server catalog, we can modify it by using the ALTER PROCEDURE statement or remove it by using DROP PROCEDURE