当前位置: 代码迷 >> Sql Server >> 很小的有关问题,请帮帮忙
  详细解决方案

很小的有关问题,请帮帮忙

热度:114   发布时间:2016-04-27 19:20:50.0
很小的问题,请各位大哥帮帮忙?
表数据表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) 
  相关解决方案