22,219
社区成员
发帖
与我相关
我的任务
分享
alter proc p_dc_confirm
(@DID varchar(8),@EIDO varchar(6),@EIDI varchar(6),@Outdate varchar(20),@Confirmdate varchar(20))
as
begin
update DC
set
DC_Innerconfirm='已收',DC_Confirmdate = cast(@Confirmdate as datetime) --sorry,补括号
from DC
where DI_ID=@DID AND EI_ID_Outer=@EIDO AND EI_ID_Inner=@EIDI AND DC_Outdate=cast(@Outdate as datetime)
end
ALTER trigger t_DC_update
on DC for update
as
if update(DC_Confirmdate)
begin
declare @EID varchar(6),@DID varchar(8),@Department varchar(15),@Indate smalldatetime
update EI_DI
SET DI_Backdate=(select DC_Outdate from inserted) where EI_ID= (select EI_ID_Outer from inserted)
select @EID = EI_ID_Inner from inserted
select @DID = DI_ID from inserted
select @Department =(select EI_Department from EI where EI_ID=@EID)
select @Indate = DC_Confirmdate from inserted
exec p_EI_DI_INS @EID,@DID,@Department,@Indate, Null --调用存储过程
end
alter proc p_dc_confirm
(@DID varchar(8),@EIDO varchar(6),@EIDI varchar(6),@Outdate varchar(20),@Confirmdate varchar(20))
as
begin
update DC
set
DC_Innerconfirm='已收',DC_Confirmdate = cast(@Confirmdate as datetime
from DC
where DI_ID=@DID AND EI_ID_Outer=@EIDO AND EI_ID_Inner=@EIDI AND DC_Outdate=cast(@Outdate as datetime)
end
如果不行,再这样。alter proc p_dc_confirm
(@DID varchar(8),@EIDO varchar(6),@EIDI varchar(6),@Outdate varchar(20),@Confirmdate varchar(20))
as
begin
update DC
set
DC_Innerconfirm='已收',DC_Confirmdate = @Confirmdate
from DC
where DI_ID=@DID AND EI_ID_Outer=@EIDO AND EI_ID_Inner=@EIDI AND DC_Outdate=@Outdate
end
这样试试。Create produce p_dc_confirm
(@DID varchar(8),@EIDO varchar(6),@EIDI varchar(6),@Outdate smalldatetime,@Confirmdate smalldatetime)
as
begin
update DC
set
DC_Innerconfirm='已收',DC_Confirmdate = @Confirmdate
where DI_ID=@DID AND EI_ID_Outer=@EIDO AND EI_ID_Inner=@EIDI AND DC_Outdate=@Outdate
end
Create produce p_dc_confirm
(@DID varchar(8),@EIDO varchar(6),@EIDI varchar(6),@Outdate smalldatetime,@Confirmdate smalldatetime)
as
begin
update DC
set
DC_Innerconfirm='已收',DC_Confirmdate = @Confirmdate
from DC
where DI_ID=@DID AND EI_ID_Outer=@EIDO AND EI_ID_Inner=@EIDI AND DC_Outdate=@Outdate
end