split out the SQL from set-datasource-info