1
2
3
4
5 CREATE PROCEDURE uspFindProductByModel (
6 @model_year SMALLINT,
7 @product_count INT OUTPUT
8) AS
9BEGIN
10 SELECT
11 product_name,
12 list_price
13 FROM
14 production.products
15 WHERE
16 model_year = @model_year;
17
18 SELECT @product_count = @@ROWCOUNT;
19END;
20
1Copy CodeCREATE PROCEDURE spGetEmployeeCountByGender
2@Gender nvarchar(20),
3@EmployeeCount int Output
4AS
5BEGIN
6SELECT @EmployeeCount = COUNT(Id)
7FROM tblEmployee
8WHERE Gender = @Gender
9END