KEMBAR78
Stored procedure in sql server | PPTX
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.
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'
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
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.
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
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

Stored procedure in sql server

  • 2.
    Stored procedure insql 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.
  • 3.
    Sample of creatingProcedure • • • • • • • • • • • • • • • • • • • 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'
  • 4.
    Advantages of usingstored 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
  • 5.
    Differences between StoredProcedures 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.
  • 6.
    If this presentationhelped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 7.
    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