2

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.

http://kb.printaudit.com/display/PA6/SQL+Server+2014+Express+Installation

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

https://alastaira.wordpress.com/ogr2ogr-patterns-for-sql-server/

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.

2

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. – RAVI BANSAL Mar 7 '18 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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