SlideShare a Scribd company logo
Stored procedure in sql server
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

More Related Content

PDF
Triggers and Stored Procedures
PPTX
5. stored procedure and functions
PPTX
Store procedures
ODP
Introduction to triggers
PPTX
Structured query language(sql)ppt
PPTX
PPTX
Triggers and Stored Procedures
5. stored procedure and functions
Store procedures
Introduction to triggers
Structured query language(sql)ppt

What's hot (20)

PDF
Integrity constraints in dbms
PPTX
4. plsql
ODP
Partitioning
PPT
Sql dml & tcl 2
PPTX
SQL Queries Information
PPT
Oracle Database Trigger
PPT
Introduction to sql
PPTX
introdution to SQL and SQL functions
PPTX
SQL Functions
PDF
PPTX
Trigger in mysql
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPT
SQL subquery
PPTX
Introduction to PostgreSQL
PPT
SQL Queries
PPTX
Stored procedure
PPTX
Sql(structured query language)
PPT
MYSQL - PHP Database Connectivity
PDF
Triggers in SQL | Edureka
PPT
Sql ppt
Integrity constraints in dbms
4. plsql
Partitioning
Sql dml & tcl 2
SQL Queries Information
Oracle Database Trigger
Introduction to sql
introdution to SQL and SQL functions
SQL Functions
Trigger in mysql
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
SQL subquery
Introduction to PostgreSQL
SQL Queries
Stored procedure
Sql(structured query language)
MYSQL - PHP Database Connectivity
Triggers in SQL | Edureka
Sql ppt
Ad

Similar to Stored procedure in sql server (20)

PDF
Stored procedure Notes By Durgesh Singh
PPTX
STORED-PROCEDURE.pptxjsjjdjdjcjcjdkksksksk
PPTX
Function and Stored Procedure. Hitesh Prajapati
PPTX
PPTX
Sql storeprocedure
PPTX
Stored Procedures
PPT
Intro to tsql
PPT
Intro to tsql unit 14
PPTX
Advance Sql Server Store procedure Presentation
PDF
A set of SQL(structured query language) statements that are designat.pdf
PPTX
PPT
Module04
PPTX
Sql Functions And Procedures
PPTX
MS SQL SERVER: Sql Functions And Procedures
PPTX
MS SQLSERVER:Sql Functions And Procedures
PPTX
PPT
SQL Server 2000 Research Series - Transact SQL
PDF
function & procedure presentation in relation database
PPTX
Lecture 3.2_Subprogrammm - Function.pptx
Stored procedure Notes By Durgesh Singh
STORED-PROCEDURE.pptxjsjjdjdjcjcjdkksksksk
Function and Stored Procedure. Hitesh Prajapati
Sql storeprocedure
Stored Procedures
Intro to tsql
Intro to tsql unit 14
Advance Sql Server Store procedure Presentation
A set of SQL(structured query language) statements that are designat.pdf
Module04
Sql Functions And Procedures
MS SQL SERVER: Sql Functions And Procedures
MS SQLSERVER:Sql Functions And Procedures
SQL Server 2000 Research Series - Transact SQL
function & procedure presentation in relation database
Lecture 3.2_Subprogrammm - Function.pptx
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
RMMM.pdf make it easy to upload and study
PDF
Pre independence Education in Inndia.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
master seminar digital applications in india
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharma ospi slides which help in ospi learning
RMMM.pdf make it easy to upload and study
Pre independence Education in Inndia.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
master seminar digital applications in india
Week 4 Term 3 Study Techniques revisited.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
TR - Agricultural Crops Production NC III.pdf
01-Introduction-to-Information-Management.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
2.FourierTransform-ShortQuestionswithAnswers.pdf
Supply Chain Operations Speaking Notes -ICLT Program

Stored procedure in sql server

  • 2. 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.
  • 3. 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'
  • 4. 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
  • 5. 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.
  • 6. 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
  • 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