Im trying to export a table from MSSQL to geopackage using ogr2ogr:
This is the exact command I try in windows terminal (but with real serv,db,user,pass ofc):
C:\OSGeo4W64\bin\ogr2ogr.exe -f "GPKG" C:/GIS/data/testdata/test123.gpkg MSSQL:database=somedbname;server=somesrv123;uid=userid;pwd=password;tables=sometable
I get errors:
ERROR 1: Error initializing the metadata tables : [37000][Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE TABLE permission denied in database 'somedbname'.(262)
and
ERROR 1: No column definitions found for table 'sometable', layer not usable.
What am I doing wrong? I can connect to the db in QGIS and ArcMap and add table to the map.
ogrinfo MSSQL:database=somedb;server=somesrv;uid=user;pwd=password;tables=sometable
ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE TABLE permission denied in database 'somedb'. and ERROR 1: No column definitions found for table 'sometable', layer not usable. INFO: Open of
MSSQL:database=somedb;server=somesrv;uid=user;pwd=password;tables=sometable' using driver
MSSQLSpatial' successful. 1: sometable
Adding the layer to QGIS and using OGR2OGR from QGIS generate errors:
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
ERROR 1: Error initializing the metadata tables : [37000][Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE TABLE permission denied in database 'somedb'.(262)
ERROR 1: No column definitions found for table 'sometable', layer not usable.
ERROR 1: Couldn't fetch requested layer 'someschema.sometable'!
ogrinfo ogr2ogr.exe MSSQL:database=somedbname;server=somesrv123;uid=userid;pwd=password;tables=sometable
work as you suppose? – user30184 Feb 2 '20 at 20:51