精选优质文档-倾情为你奉上实验7 存储过程和触发器的使用1. 存储过程 创建存储过程,使用Employees表中的员工人数来初始化一个局部变量,并调用这个存储过程USE YGGLGOCREATE PROCEDURE TEST NU MBER int OUTPUTASBEGINDECLARE NU MBER2 inTSET NU MBER2=(SELECT COUNT(*) FROM Employees)SET NU MBER1=NU MBER2END 创建存储过程,比较两个员工的实际收入,若前者比后者高就输出0,否则输出1BEGINDECLARE SR1 float, SR2 FLOATSELECT SR1=InCome-OutCome FROM Salary WHERE EmployeeID=ID1SELECT SR2=InCome-OutCome FROM Salary WHERE EmployeeID=ID2IF ID1ID2SET BJ=0ELSE