• Post category:StudyBullet-7
  • Reading time:5 mins read


Create and execute stored procedure

What you will learn

Setup SQL Server Database

Setup MySQL Database

Create a stored procedure

Execute stored procedure

Modify stored procedure

Delete stored procedure

Description

A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again.

So if you have an SQL query that you write over and over again, save it as a stored procedure, and then just call it to execute it.

You can also pass parameters to a stored procedure,Β  so that the stored procedure can act based onΒ  the parameter value(s) that is passed.

A stored procedure is used to retrieve data, modify data, and delete data in database table. You don’t need toΒ  write a whole SQL command each time you want to insert, update or delete data in an SQL database.

Benefits of using a stored procedure


Get Instant Notification of New Courses on our Telegram channel.


It can be easily modified: We can easily modify the code inside the stored procedure without the need to restart or deploying the application. For example, If the T-SQL queries are written in the application and if we need to change the logic, we must change the code in the application and re-deploy it. SQL Server Stored procedures eliminate such challenges by storing the code in the database. so, when we want to change the logic inside the procedure we can just do it by simple ALTER PROCEDURE statement.

Reduced network traffic: When we use stored procedures instead of writing T-SQL queries at the application level, only the procedure name is passed over the network instead of the whole T-SQL code.

Reusable: Stored procedures can be executed by multiple users or multiple client applications without the need of writing the code again.

Security: Stored procedures reduce the threat by eliminating direct access to the tables. we can also encrypt the stored procedures while creating them so that source code inside the stored procedure is not visible.

English
language

Content

SQL Server Setup

Introduction
What is SQL Server
Download SQL Server
Install SQL Server
Install SSMS
Connect SSMS to SQL Server
Install sample database
What is SQL
What is a stored procedure

SQL Sever Stored Procedures

Creating stored procedures
Modifying stored procedures
Properties page of a stored procedure
Viewing dependencies of a stored procedure
Viewing definition of a stored procedure
Deleting a stored procedure

MySQL Server Setup

What is MySQL
Install MySQL on Windows
Creating databases
Creating Tables

MySQL Stored Procedures

Creating stored procedure
Modifying stored procedure
Creating an advanced stored procedure
Calling and deleting stored procedures