このコードを使用すると、行が挿入されます
create trigger [dbo].[InsertInvPayment] on dbo.LG_001_01_PAYTRANS
after update
as
begin
SET NOCOUNT ON;
declare @InvLogicalRef int;
declare @InvNumber varchar(50);
select @InvLogicalRef = inserted.FICHEREF from inserted
select @InvNumber = dbo.LG_001_01_INVOICE.DOCODE from dbo.LG_001_01_INVOICE where dbo.LG_001_01_INVOICE.LOGICALREF = @InvLogicalRef
insert into dbo.CRMINVPAYMENT(INVNUMBER) values('Hello')
end
このように変更すると
create trigger [dbo].[InsertInvPayment] on dbo.LG_001_01_PAYTRANS
after update
as
begin
SET NOCOUNT ON;
declare @InvLogicalRef int;
declare @InvNumber varchar(50);
select @InvLogicalRef = inserted.FICHEREF from inserted
select @InvNumber = dbo.LG_001_01_INVOICE.DOCODE from dbo.LG_001_01_INVOICE where dbo.LG_001_01_INVOICE.LOGICALREF = @InvLogicalRef
insert into dbo.CRMINVPAYMENT(INVNUMBER) values(@InvNumber)
end
うまくいきません。私は2番目に間違いを見つけることができませんでした