I can't think of a good way to do this in the DB, but good source control policies can help mitigate this. Also, your code should be periodically reviewed by more skilled SQL experts. Lax source control tends to be the cause of a lot of problems..
CEWII