Update Trigger inserts data into 2 tables with 2nd insert using data from 2 tables
Here is what I have. I have 3 Tables. When a certain field in Table A gets updated to Yes I have an udpdate trigger that has an insert statement that puts the updated row (row that a field got changed to yes) into Table B. Now I need to insert some of the data from the updated row in Table A and I need the UniqueID of the newly inserted Row in Table B and insert the data from Table A and Table B into Table C.
Here is what I have so far and it work good. It inserts data from the row that was update in Table A into Table B:
CREATE TRIGGER ToInsertRow ON TableA
INSERT INTO TableB(
SELECT inserted.Column1, inserted.Column4
WHERE inserted.YesNoColumn = 'Yes'
Thanks in Advance
Microsoft SQL Server
8/22/2022 - Mon
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat