DECLARE @SISubsidy
TABLE
(ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY, SINumber BIGINT)
TABLE
(ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY, SINumber BIGINT)
INSERT @SISubsidy
SELECT DISTINCT I.SINumber
FROM
Inserted I
INNER JOIN
Deleted D
ON I.SINumber = D.SINumber
WHERE I.Status=5 AND D.Status=4
SELECT @MaxCount = Max(ID) FROM @SISubsidy
Declare @Index int
Set @Index = 1
WHILE @Index <= @MaxCount
BEGIN
SELECT @SINo = SINumber FROM @SISubsidy WHERE Id=@Index
EXEC SI_SubsidyCreditInvoice @SINo
SET @Index = @Index + 1
END
No comments:
Post a Comment