I am trying to export some spatial data from SQL Server 2012 to Spatialite with the following command
ogr2ogr -f SQLite -update C:\tmp\Spatial.sqlite -nln "my_polygons" "MSSQL:server=host;database=MySQLDB;trusted_connection=yes;GeometryFormat=native;" -sql "SELECT * FROM MySQLDB.dbo.my_polygons" -lco SPATIAL_INDEX=yes -gt 65536
Ogr2ogr does write from SQL Server to my Spatialite db however the imported table is not recognised as a spatial table.
When trying to view the result in QGIS is doesn't show any polygons. However I can see the table and the attributes!