Improved Insert/Update/Delete stored procs and skeleton for lock/unlock