I am a newbie and I'm trying to import a shapefile into SQL Express 2014 via the OGR2OGR tool and I am facing errors.

I installed SQL Express 2014 following this article.


Afterward, I followed the below-mentioned article for Shapefile Import.


Then I installed QGIS version 2.10. This is the command I entered:

ogr2ogr -f MSSQLSpatial "MSSQL:server=JDOE\SQLEXPRESS;database=MySpatial;trusted_connection=yes" C:\Users\jdoe\Desktop\ShapeFile\MyShapeFile.shp -nln "Spatial" -progress

This is the error I am getting:

ERROR 1: INSERT command for new feature failed. [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error converting numeric to data type numeric.
ERROR 1: Unable to write feature 0 from layer MyShapeFile.
ERROR 1: Terminating translation prematurely after failed translation of layer Ontario_FED_2015 (use -skipfailures to skip errors)

Please suggest what am I doing wrong here.

1 Answer 1


It looks like you have not created the database:

MSSQL Spatial driver doesn't currently support database creation

Try creating your database and try again.

  • Thanks, @Ian. I created the database and tried again. And now, I am getting a different error message. I have updated my question to reflect the same. Please advise.
    – ravsun
    Mar 7, 2018 at 18:52

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.