I imported a shapefile into MSSQL with geometry type.
ogr2ogr -f "MSSQLSpatial" "MSSQL:server=AAAAAA; database=BBBB; User Id=CCCC; Password=DDDDD;" "TEST.shp"
Insert into test2 select GEOGRAPHY::STGeomFromText(cast[ogr_geometry] as varchar (Max), 4326)
Intersect doesn't work and I get the following results
DECLARE @g geography;SET @g = geography::STGeomFromText('POLYGON((139.6340168 35.6073283,139.8998358 35.6073283,139.8998358 35.7219415,139.6340168 35.7219415,139.6340168 35.6073283))', 4326 );
SELECT A.ogr_geography
FROM [test2] A WITH (NOLOCK, INDEX=[spidx_test2]) WHERE A.ogr_geography.STIntersects( @g ) = 1
question from:https://stackoverflow.com/questions/66057877/ogr2ogr-fail-with-st-intersects