Michael Johnson has a new SQL procedure for us. This time he helps make Deleting Empty SOP Batches Easy.
Deleting Empty SOP Batches Made Easy in Dynamics GP
Archived post from 2010. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.