0

I am trying to use ogr2ogr to import GML file into SQL Server Spatial. I successfully import features with geometry, but I have few without geometry column. How can I import all of them?

EDIT:

I reinstalled GDAL, installed latest, works fine, but again cann't write non-spatial features.

Constantly getting error:

ERROR 1: Error creating layer: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'NULLCONSTRAINT'.

Aleksandar
  • 1,163
  • 22
  • 41

1 Answers1

0

The error looks like incorrectly formed SQL statement, created by ogr2ogr against the SQL database.

Have you tried running SQL Server Profiler (within SQL Server) whilst you do the import? Assuming you run a standard trace, you will need to locate the row with NULLCONSTRAINT in the textData column in the trace output. Once you have found the problem statement, this should give you some idea how to fix the problem.

If you need a very simple tutorial on the Profiler this link might help http://www.mssqltips.com/sqlservertutorial/272/profiler-and-server-side-traces/

A similar error for me was caused by square brackets in the shapefile name I was importing which meant the create table statement was invalid.

cabbagetreecustard
  • 647
  • 2
  • 13
  • 22