If you want to delete the rows that are related – you could modify the tables to use ON DELETE CASCADE. However, if you do not want to delete the related rows you are going to have to update the foreign keys to a different value then delete the rows.
That is – on table 1 update the rows with value ‘x’ to value of ‘y’ and delete from table2 the rows that have the value ‘x’. Then update the values in table2 with value ‘a’ to value ‘b’ – then delete from table1 the rows that have value ‘a’.
Before doing any of this – I would recommend that you copy the data in both tables so you can put the data back if something doesn’t work right.
Problems are opportunities brilliantly disguised as insurmountable obstacles.
How to post questions to get better answers faster[/url]
Managing Transaction Logs[/url]