Implement SQL export.