The method you're using is just fine. Though, I would argue that you shouldn't be trying to insert a property into table1 without having made sure it exists in table2 first. I think you're putting the cart before the horse somewhere in your application's logic.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?