create proc test @emp varchar(20) as
declare @empno varchar(20),@id1 int,@id2 int
select @id1=max(recordid) from empdorm where empid=(select empid from employee where empno= @emp)
select @id2=max(recordid) from empdorm where empid=(select empid from employee where empno=@emp) and enddate is not null
begin
update empdorm set enddate='2009-03-01' where recordid= @id2
update empdorm set begindate='2009-03-01' where recordid= @id1
end
sql存储过程
最新推荐文章于 2024-09-14 18:42:05 发布