An Introduction of Stored Procedure in SQL

In this article I am going to explain about stored procedure.
  • 2008

Introduction

In this article I am going to explain about stored procedure. A store procedure is a database object that contains one or more SQL statement. store procedure is also known as sproc or procedure. We use CREATE PROC statement for creating a store procedure. For executing a store procedure we use EXEC statement.

Stored procedure are precompiled. we don't need to compile again these stored procedure at using time. It makes stored procedure faster than execution of normal SQL statement.

A Statement that create invoices table

Clipboard0111.jpg

Statements that insert data in invoices table

Clipboard04.jpg

A Statement that is used to fetch data from invoices table

Clipboard06.jpg

A Statement that create vendors table

Clipboard08.jpg

Statements that insert data in vendors table

Clipboard10.jpg

A Statement that is used to fetch data from vendors table

Clipboard14.jpg

A Statement that creates a Stored Procedure

Clipboard16.jpg

A Statement that run the Stored Procedure

Clipboard18.jpg


© 2013 dotNetheaven. All rights reserved.