Hi everybody,
I have a stored procedure that accepts lots of parameters and called PeopleInsert. I have another procedure that is called SaveApprovedPeople.
In the SaveApprovedPeople procedure it first updates registration table (sets status to approved) and then inserts into People and related tables information from registration table. The logic of insert should be the same as PeopleInsert (except that instead of parameters I'm using Registration table record).
My question is - how should I somehow incorporate the logic of one procedure into another? Because I found that there is no error checking in SaveApprovedPeople and we have at least 2 business rules - no same userID and no same people to be inserted.
These rules I currently have implemented inside the stored procedure - may be this is my error? May be I needed to implement them as triggers?
Thanks in advance.
If it's not broken, fix it until it is.
My Blog