how to create a a stored procedure from query in sql code example
Example 1: create procedure sql
CREATE PROCEDURE SelectAllCustomers @City nvarchar(30), @PostalCode nvarchar(10)
AS
SELECT * FROM Customers WHERE City = @City AND PostalCode = @PostalCode
GO;
Example 2: create select stored procedure in sql server
CREATE PROCEDURE sp_getRaces
AS
BEGIN
SELECT * FROM dbo.Races
END ;