October 31st, 2012, 01:25 AM
Join Date: Oct 2012
Time spent in forums: 13 m 26 sec
Reputation Power: 0
Trigger with multiple lines
Good day. What am I trying to achieve is when line in Sales Line table in Navision is deleted then insert data from deleted record to new table.
This is working fine (with the code below) if I delete one single line, however not working for multiple lines. Can you help me to do same functionality for multiple lines.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
ALTER TRIGGER [dbo].[KkSalesLines]
ON [dbo].[Sales Line]
DECLARE @document_no nchar(20)
DECLARE @line_no nchar(20)
SET @document_no = (SELECT [Document No_] FROM deleted)
SET @line_no = (SELECT [Line No_] FROM deleted)
INSERT INTO DeletedSalesLine