My question is what's the best way to swap settings between the two computer records and swap any software installed? Ideally I'd like it in the form of a function where I can pass the two p_id's and return a boolean reflecting success (true) or fail (false).
I'd say something like that (generic table names) :
If you're confident :
UPDATE stuff SET owner = (CASE IF owner='A' THEN 'B' ELSE 'A' END) WHERE owner IN ('A','B')
If you're paranoid :
UPDATE stuff SET owner = (CASE IF owner='A' THEN 'B' ELSE IF owner='B' THEN 'A' ELSE owner END) WHERE owner IN ('A','B')
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings