Ok, I have 4 tables (table1,table2,table3,table4)
Each table is from a different health insurance company that has information on employees where I work. One employee may be in multiple tables. However, the tables contain different information on employees. For example, one table may have the employee address where as the next table may not, but it does have the employee age. The information that all 4 tables have in common is employee last name, first name, and birthday. I want to insert this information into one table, but as I do it I want to make sure that I am not inserting an employee twice.
My process is to be as folllows: If employee exists in main_table, then update existing information, else insert it. This way I should get information from all tables on each employee but I will not have duplicate employees.
If you are asking for my code, I really don't have any if you're telling me to ignore the cursor. That was what I had...I wanted to use a cursor to go through a select statement that took from all 4 tables and inserted one by one into the main table.
Since you're telling me not to use a cursor, I'm not looking for someone to paste a bunch of code in here so I can just copy and paste, but if you have a quick suggestion on another way to do what I am trying to accomplish I am all ears.
Thanks