in reply to SQL execution engine - best approach?
Maybe you might want to look into a database engine that supports store procedures. Have you considered changing to a Model, View, Controller approach and/or LAMP (P->Perl), instead of the client-server approach you are using now?