Stored Procedure -
A "Stored Procedure" is a named group of pre-compiled SQL statements which are created and stored in the server database.
- A Stored Procedure can be reused.
- Stored procedures accept the input parameters.
Syntax to Create a Stored Procedure in SQL server -
CREATE PROCEDURE ProcedureName
AS
BEGIN
---------------
AS
BEGIN
---------------
SQL Query
---------------
END
END
Syntax to Call a Stored Procedure in SQL server -
EXEC ProcedureName