in reply to SQL question: Insertion with FK constraint

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:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re: SQL question: Insertion with FK constraint