Stored procedure in sql server
• Description:

• A stored procedure is a group of sql statements
that has been created and...
Sample of creating Procedure

•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

create procedure sp_department
(
@department_name var...
Advantages of using stored procedures
a) Stored procedure allows modular
programming.
b) Stored Procedure allows faster ex...
Differences between Stored Procedures and Functions
• Procedure can return zero or n values whereas function
can return on...
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.c...
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Vil...
Stored procedure in sql server
Upcoming SlideShare
Loading in …5
×

Stored procedure in sql server

1,312 views

Published on

Stored procedure in sql server

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Stored procedure in sql server

  1. 1. Stored procedure in sql server • Description: • A stored procedure is a group of sql statements that has been created and stored in the database. Stored procedure will accept input parameters so that a single procedure can be used over the network by several clients using different input data. Stored procedure will reduce network traffic and increase the performance.
  2. 2. Sample of creating Procedure • • • • • • • • • • • • • • • • • • • create procedure sp_department ( @department_name varchar(30), @department_active bit ) as begin insert into tbl_department ( department_name, department_active ) values ( @department_name, @department_active ) end exec sp_department 'kannada','true'
  3. 3. Advantages of using stored procedures a) Stored procedure allows modular programming. b) Stored Procedure allows faster execution. c) Stored Procedure can reduce network traffic. d) Stored procedures provide better security to your data
  4. 4. Differences between Stored Procedures and Functions • Procedure can return zero or n values whereas function can return one value which is mandatory. • Procedures can have input/output parameters for it whereas functions can have only input parameters. • Procedure allows select as well as DML statement in it whereas function allows only select statement in it. • Functions can be called from procedure whereas procedures cannot be called from function. • Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
  5. 5. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  6. 6. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550

×