zhuxiongfeng
alter trigger material_trigger
on tb04_material  for insert
as
begin
    declare @materialId int
    select @materialId=i.material_id from inserted i
    declare @G_StatisticsId int
    exec @G_StatisticsId = sp_GetUniqueID \'tb04_statistics\',@G_StatisticsId
    declare @dateNow datetime
    declare @year int
    declare @month int
    set @dateNow=getdate()
    set @year=year(@dateNow)
    set @month=month(@dateNow)
    insert into tb04_statistics(id,year,month,begin_value,end_value,material_id)
                                values(@G_StatisticsId,@year,@month,0,NULL,@materialId)
end

分类:

技术点:

相关文章:

  • 2021-11-09
  • 2022-03-14
  • 2022-03-09
  • 2021-12-27
  • 2021-12-11
  • 2022-01-10
  • 2022-12-23
  • 2021-10-22
猜你喜欢
  • 2022-12-23
  • 2022-03-14
  • 2021-10-23
  • 2022-12-23
  • 2021-10-15
  • 2021-11-28
相关资源
相似解决方案