2. Introduction
• Store Procedure is an SQL query , which we save so that we can use it again
and again to save our time.
• It has ability to pass parameter at the time of execution and execute the
result according to it.
• The main benefit of using store procedure is to increase the performance
rate of the database.
3. Syntax
Create Procedure Procedure-name
( It is the name of Store Procedure
Input parameters ,
Output Parameters (If required)
)
As
Begin
Sql statement used in the stored procedure
End
4. Example
CREATE PROCEDURE teststoreprocedure
AS It is the name of Store Procedure
SELECT * FROM Works.Person
GO Name of Database Name of table
5. How to create PROCEDURE
CREATE PROCEDURE testprod2 @name nvarchar(30)
AS
SELECT *
FROM TestNew.dbo.person
WHERE Name LIKE @name + '%'
GO