【正文】
ent_header,department_num from departmentinfo where department_id=@department_id select department_id,department_name,department_header,department_num from departmentinfo GO 示例: 10)員工工資增加 代碼: CREATE PROCEDURE addemployeepay @midyear smalldatetime=null, @employee_id char(4)=null, @position_id char(4)=null, @housing smallmoney=null, @subsidy smallmoney=null, @unionfee smallmoney=null, @waterelecfee smallmoney=null, @housingfee smallmoney=null, @agedsafety smallmoney=null, @prize smallmoney=null, @punish smallmoney=null, set @basepay=(select basepay from position) smallmoney, set @postpay=(select postpay from position) smallmoney AS if @midyear is null or @employee_id is null or @position_id is null or @housing is null or @subsidy is null or @unionfee is null or @waterelecfee is null or @housingfee is null or @agedsafety is null or @prize is null or @punish is null begin print39。請輸入具體的工資信息 39。 print39。請重新輸入 39。 return end begin tran insert employeepay (midyear,employee_id,position_id,housing,subsidy,unionfee,waterelecfee, housingfee,agedsafety,prize,punish,basepay,postpay) values (@midyear,@employee_id,@position_id,@housing,@subsidy,@unionfee,@waterelecfee, @housingfee,@agedsafety,@prize,@punish,@basepay,@postpay) if @@error 0 begin rollback tran return end mit tran print 39。工資信息已經(jīng)成功添加到表 employeepay中。 39。 GO 示例: 11) 員工工資刪除 代碼: CREATE PROCEDURE employeepaydelete @employee_id char(9) AS begin tran delete from employeepay where employee_id=@employee_id mit tran print39。已經(jīng)刪除員工編號為 39。+@employee_id+39。的員工的工資信息。 39。 GO 示例 : 12) 員工工資修 改 代碼: CREATE PROCEDURE updateemployeepay AS begin update employeepay set prize=3000,subsidy=5000 where employee_id=39。0439。 end print 39。該員工的部分工資信息已經(jīng)修改 , 其獎金和津貼已經(jīng)提高。 39。 GO 示例: 13)員工工資查詢 代碼: CREATE PROCEDURE anyoneemployeepay @id char(7) As select ,employee_name,position_name,department_name,midyear,housing,subsidy, unionfee,waterelecfee,housingfee,agedsafety,prize,punish,posit from employeepay inner join employeebaseinfo