bustercoder
Programmer
- Mar 13, 2007
- 96
Hello,
Is it possible to auto increment a number in an insert trigger. For instance:
ALTER TRIGGER [dbo].[trig_insertFreightLine] ON dbo.Test_Shipments_Import
FOR INSERT, UPDATE, DELETE
AS
if exists (select * from inserted)
begin
insert SOP10102
select distinct 3,ORDER_ID,102,7,'',83,0,0,FREIGHT_AMOUNT,FREIGHT_AMOUNT,2999,'',0
from inserted
end
The "102" value you see in the above trigger needs to be incremented each time the trigger fires. Is this possible, and if so, could someone please show me how?
Thanks,
Buster
Is it possible to auto increment a number in an insert trigger. For instance:
ALTER TRIGGER [dbo].[trig_insertFreightLine] ON dbo.Test_Shipments_Import
FOR INSERT, UPDATE, DELETE
AS
if exists (select * from inserted)
begin
insert SOP10102
select distinct 3,ORDER_ID,102,7,'',83,0,0,FREIGHT_AMOUNT,FREIGHT_AMOUNT,2999,'',0
from inserted
end
The "102" value you see in the above trigger needs to be incremented each time the trigger fires. Is this possible, and if so, could someone please show me how?
Thanks,
Buster