execute sql stored procedure code example
Example 1: sql server stored procedure
CREATE PROCEDURE spGetEmployeeCountByGender
@Gender nvarchar(20),
@EmployeeCount int Output
AS
BEGIN
SELECT @EmployeeCount = COUNT(Id)
FROM tblEmployee
WHERE Gender = @Gender
END
Example 2: run stored procedure sql
-- Datagrip:
call MY_SCHEMA.my_procedure();
-- SQL Developer
exec MY_SCHEMA.my_procedure();
-- Shorter than :
BEGIN
MY_SCHEMA.my_procedure();
END;