create select stored procedure in sql server
snippet in sql

sql create stored procedure

user8696

----------------------------------------------------------------------------------------------------
-- MySQL (scroll down for Oracle)

-- example
CREATE OR REPLACE PROCEDURE select_employees()
BEGIN
   select * 
   from employees 
   limit 1000; 
END; -- Reset the delimiter

/* syntax:
CREATE PROCEDURE <Your-procedure-name>(<argument1><argument2>...<argumentN>)
BEGIN
   <Code-that-stored-procedure-executes>; 
END;
*/

----------------------------------------------------------------------------------------------------
-- Oracle

-- EXAMPLE
CREATE OR REPLACE PROCEDURE select_employees()
BEGIN
   select * 
   from employees 
   limit 1000; 
END;

/* SYNTAX
CREATE OR REPLACE PROCEDURE <Your-procedure-name>(<argument1><argument2>...<argumentN>)
BEGIN
   <Code-that-stored-procedure-executes>; -- Remember, the delimiters within the stored procedure remain ;
END;
*/
----------------------------------------------------------------------------------------------------

create select stored procedure in sql server

user3830

CREATE PROCEDURE sp_getRaces
AS
BEGIN 
SELECT * FROM dbo.Races
END ;

create select stored procedure in sql server

user2626

CREATE PROCEDURE sp_getRaces
AS
BEGIN 
SELECT * FROM dbo.Races
END ;

create proc sql

user6862


  EXEC SelectAllCustomers;