CREATE trigger tr_fkpz on 付款凭证
for insert
as
declare @CusName VARCHAR(100),
@Mname varchar(100),
@GradeName varchar(100),
@Jweight decimal,
@ID char(15),
@NUM int,
@count int
select @count=count(*) from ls
set @NUM=1
while @NUM<@count+1
begin
select @ID=ID from ls where NUM=@NUM
uPDATE App_Ponderation SET YS=1 where IDcode=@ID
end
SET @NUM=@NUM+1
CREATE trigger tr_fkpz on 付款凭证
for insert
as
declare @CusName VARCHAR(100),
@Mname varchar(100),
@GradeName varchar(100),
@Jweight decimal,
@ID char(15),
@NUM int,
@count int
select @count=count(*) from ls
set @NUM=1
while @NUM<@count+1
begin
select @ID=ID from ls where NUM=@NUM
uPDATE App_Ponderation SET YS=1 where IDcode=@ID
SET @NUM=@NUM+1
end
用这试试
CREATE trigger tr_fkpz on 付款凭证
for insert
as
declare @CusName VARCHAR(100),
@Mname varchar(100),
@GradeName varchar(100),
@Jweight decimal,
@ID char(15),
@NUM int,
@count int
select @count=count(*) from ls
set @NUM=1
while @NUM<@count+1
begin
select @ID=ID from ls where NUM=@NUM
uPDATE App_Ponderation SET YS=1 where IDcode=@ID
SET @NUM=@NUM+1