Comment: Is there an excellent reason forcoding this in a trigger? Complex business logic like this is generally best left to whatever procedure is doing the inserting.