Assuming you're doing this directly through sql, did you clean up the tables starting with SO (SO_PAYMENTS...)? There may be a better way to do this - there's always reinstall, or even reinstall just the SO module using the sql instructions there to recreate the tables it needs.