CREATE PROCEDURE EmployeesProc 
	@TitleOfCourtesy nvarchar(25),
	@empCount int OUTPUT 
AS
/* 查询满足条件的记录 */
SELECT EmployeeID,LastName,FirstName,Title,TitleOfCourtesy
	FROM Employees WHERE TitleOfCourtesy=@TitleOfCourtesy
/* 统计满足条件的记录数 */
SELECT @empCount = COUNT(*) 
	FROM Employees WHERE TitleOfCourtesy=@TitleOfCourtesy
GO
