Michael Johnson has updated his post on Reconciling SOP Batches in Dynamics GP to provide some additional features in the SQL script.
Reconciling SOP Batches in Dynamics GP Revisited
General Ledger & FinancialsSales, Purchasing & InventoryInstall, Upgrade & Admin
Archived post from 2010. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.