I use ogr2ogr (bundled with QGIS 2.14.3) on Windows to convert an ArcSDE MS SQL Server 2012 database with SQL Geometry to PostGIS (2.1.8). I use the following syntax:

ogr2ogr --config PGCLIENTCODING ISO-8859-2 -f "PostgreSQL" PG:"host=localhost user=postgres dbname=atlas password=secret" "MSSQL:server=srv-sql;database=test;trusted_connection=yes" -a_srs "EPSG:23700" -lco GEOMETRY_NAME=geom

It seems to do the conversion, all tables are copied, but I get this error:

ERROR 1: Error initializing the metadata tables :

From other post it seems that it is related to the MS SQL driver or the geometry_columns table, but I can't seem to find the problem as the error message does not continue...

Do I need to worry about this? Or how to get rid of this?

  • Did you ever find the answer to your question? Im getting the same error message and it continues with: [Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE TABLE permission denied in database 'SomeDatabaseName'.
    – Bera
    Commented Oct 15, 2018 at 12:34
  • 1
    It's been awhile since I had this question, though I could find what was the problem in my case, see my answer for another question gis.stackexchange.com/questions/164680/… Commented Oct 17, 2018 at 10:55


Your Answer

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