<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi all -</p>
<p>I'm trying to use ogr2ogr to read shape data into a SQL Server
Spatial database using ogr2ogr. <br>
</p>
<p>The problem is that I have a insert trigger (which is absolutely
necessary) on the receiving table.</p>
The command is like this:<br>
<pre><b>ogr2ogr.exe --config MSSQLSPATIAL_USE_BCP false -append -skipfailures -a_srs EPSG:25832 -nlt PROMOTE_TO_MULTI -nln gnss_data -lco SCHEMA=transit -lco SPATIAL_INDEX=no -lco GEOMETRY_NAME=sp_geometry -lco FID=mi_prinx -dialect SQLITE -sql "SELECT ID AS id, TYPENAVN AS typenavn, KATEGORI AS kategori, REGISTRE AS registrering, ST_GeometryType(geometry) AS kommentar, DATO AS oprettet, INITIALER AS ini, 'Punkter.shp' AS filepath, geometry as sp_geometry from ""Punkter"" where IsEmpty(geometry) = 0 and IsValid(geometry) = 1" -f "MSSQLSpatial" "MSSQL:server=localhost\SQLExpress;database=drc-spor;trusted_connection=yes;" "Punkter.shp"</b><b>
</b>
</pre>
<p>Activates trigger, but is slow (even if I deactivate the trigger)
<br>
</p>
<pre>
<b>ogr2ogr.exe --config MSSQLSPATIAL_USE_BCP true -append -skipfailures -a_srs EPSG:25832 -nlt PROMOTE_TO_MULTI -nln gnss_data -lco SCHEMA=transit -lco SPATIAL_INDEX=no -lco GEOMETRY_NAME=sp_geometry -lco FID=mi_prinx -dialect SQLITE -sql "SELECT ID AS id, TYPENAVN AS typenavn, KATEGORI AS kategori, REGISTRE AS registrering, ST_GeometryType(geometry) AS kommentar, DATO AS oprettet, INITIALER AS ini, 'Punkter.shp' AS filepath, geometry as sp_geometry from ""Punkter"" where IsEmpty(geometry) = 0 and IsValid(geometry) = 1" -f "MSSQLSpatial" "MSSQL:server=localhost\SQLExpress;database=drc-spor;trusted_connection=yes;" "Punkter.shp"</b><b>
</b>
</pre>
No error and data is correctly read and imported fast, but no
trigger activation.<br>
<strong></strong>
<p><br>
</p>
<p>Is there a qualifier/config option to get a trigger executed even
if you are using the bcp-copy method for importing data into
SQLServer ?<br>
</p>
<pre class="moz-signature" cols="72">
--
Med venlig hilsen / Kind regards
Bo Victor Thomsen
</pre>
</body>
</html>