im trying to import some shapes to SQL using ogr2ogr command following this guide https://alastaira.wordpress.com/ogr2ogr-patterns-for-sql-server/
Im using this command:
ogr2ogr -overwrite -f MSSQLSpatial [connection string] [shapefile] -nln "shape3" -nlt GEOMETRY
and getting this error:
ERROR 1: INSERT command for new feature failed. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.shape3'. ERROR 1: Unable to write feature 0 from layer tl_2010_06_zcta510. ERROR 1: Terminating translation prematurely after failed translation of layer tl_2010_06_zcta510 (use -skipfailures to skip errors)
The command does not create the table and the inserts fails.
I tried to create the table first and using the command to insert on it:
ogr2ogr -f "MSSQLSpatial" [connection string] [shapefile] -a_srs "ESPG:4269" -lco "GEOM_TYPE=geography" -lco "GEOM_NAME=area" -nln "shapes3"
It works fine exept that it does not load the GEOGRAPHY colum (area), it remains NULL.
Im using the file provided in the guide and the user in the connection string is the admin so it is not a permission problem.
Thank you all in advance.