How to Create a Stored Procedure in SQL
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.
SYNTAX
CREATE PROCEDURE procedure_name
|
EXAMPLE
CREATE PROCEDURE SelectAllEmployee
|
Stored Procedure with One Parameter
CREATE PROCEDURE SelectAllEmployee
|
Stored Procedure with Multiple Parameter
CREATE PROCEDURE SelectAllCustomers
|
Modifying an existing stored procedure
ALTER PROCEDURE SelectAllEmployee
|
Drop Stored Procedure in SQL
DROP PROCEDURE [dbo].[SelectAllEmployee]
|