书写的存储过程如下:
CREATE proc proc_diaodong
(
@UID varchar(50),
@UName varchar(50),
@RemoveDate varchar(50),
@OldDep varchar(50),
@NewDep varchar(50),
@OldDuty varchar(50),
@NewDuty varchar(50),
@OldPay decimal,
@NewPay decimal,
@PayExplain varchar(50),
@Result int output
)As
Begin
Begin Transaction
Update tb_employee set employeeDept = @NewDep,employeeDuty = @NewDuty ,employeePay = @NewPay where employeeID = @UID
Insert Into tb_redeploy(UID,UName,URemoveDate,UOldDep,UNewDep,UOldJob,UNewJob,UOldPay,UNewPay,UPayExplain)
values(@UID,@UName,@RemoveDate,@OldDep,@NewDep,@OldDuty,@NewDuty,@OldPay,@NewPay,@PayExplain)
Commit Transaction
If(@@ERROR <> 0)
Rollback Transaction
select @Result = @@ERROR
End
return
GO
此主题相关图片如下:窗口.jpg
我在窗口中想调用此存储过程,在增加的按钮事件中调用并给参数赋值,请教如何用?