表数据表staff,字段为staff_id,staff_code
在存储过程中
@staff_id
as
DECLARE @staff_code varchar(50)
set @[email protected]_id得到staff_code
INSERT INTO pact(staff_code)
value(@staff_code)
go
------解决方案--------------------
@staff_id
as
DECLARE @staff_code varchar(50)
SELECT @staff_code=staff_code from staff where [email protected]_id
INSERT INTO pact(staff_code)
value(@staff_code)