1

I am trying to export data from postgres to MSSQL. While

ogr2ogr -nln outputLayerName -f "MSSQLSpatial" "MSSQL_conn_string" --config MSSQLSPATIAL_USE_GEOMETRY_COLUMNS NO "postgres_conn_string" input_table_name -overwrite -progress

is executing, I tried to do ogrinfo or pythons ogr.Open() on MSSQL_conn_string, but both stay in pending status as long as ogr2ogr is executing. Does anyone had similar problem ? The reason why I'm doing this is catching number of imported features while ogr2ogr is running.

1
  • 1
    I am rather sure that your issue is driver specific and affects MSSQL but not all GDAL vector drivers. Perhaps you could edit the title to emphasize that.
    – user30184
    Commented Oct 10, 2022 at 15:14

1 Answer 1

0

@Goran, I've had mixed experiences using ogr2ogr to import into MSSQL. Out of curiosity, you might try adding this to your command just to see what happens:

--config MSSQLSPATIAL_USE_BCP NO

See this answer and the question it's posted on for a little more detail. Of note‒I recommend trying this option even if you don't think it's relevant!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.