I keep getting this Error 1 when I run the following on some tables

ogr2ogr -skipfailures -f "MapInfo File" -lco overwrite=yes -lco launder=no -lco relaxedFieldNameMatch "D:\QG\CREFNO.tab" "MSSQL:Server=zzzz;Database=GIS_Test;Trusted_Connection=True" -sql "SELECT * FROM dbo.vw_AUTH_CREFNO" -a_srs EPSG:28354 -t_srs EPSG:28354 -s_srs EPSG:28354

enter image description here

Is there some switch to include that fixes this?

I see that in the DB you can add a convert switch but is it possible to do this in OGR2OGR? https://stackoverflow.com/questions/21984110/conversion-failed-when-converting-the-varchar-value-simple-to-data-type-int

I need to keep the output format as .tab


Found an answer on dba se - https://dba.stackexchange.com/questions/231726/fix-ogr2ogr-failed-when-converting-the-varchar-value-to-data-type-int-issue-in/231728#231728 We need to go back to the DB.

In the DB we have to change what values are allowed or mapfieldtypes to change varchar to string rather than int.

Your Answer

