How to create trigger that handles multiple records?
I have two tables A and B.
I want to create a trigger on table A for insert, update that should handle multiple records.
In the trigger I have some variable which I calculated as I want from the fields of Table A.
Now I want to create a trigger that will insert or update the Table B using available variable int the trigger. The trigger should take care of the following cases.
1. If record for the ID (ID is the primary key in Table B) in Table B is available then it updates some fields in Table B.
2. If record for the ID (ID is the primary key in Table B) in Table B is not available then insert new row in Table B.
How do I write such type of trigger in SQL server 2005?
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.