Looking for an SQL Query to do the following:
- insert all values of column
xoftable1to columnyoftable2if
they don’t exist in table2 - delete records from column
table2if the value of clumnydoesn’t exist anymore in
columnxoftable1
I tried insert or ignore for the insert query with no luck in sql server 2008 R2
Sounds like a perfect fit for an SQL Server
MERGE;An SQLfiddle to test with.