I have been trying various methods to import a shapefile into MSSQL but keep getting
FAILURE: no source datasource provided.
ATTEMPTS
ogr2ogr -f "MSSQL:Server=xxx;Database=_GIS_Test;UID=yyy;PWD=zzz" -nln “D:\QGIS_Development\mssql\bridges.shp” “MGM_Bridges_test” a_srs EPSG:4326 -t_srs EPSG:28354 -nln “MGM_Bridges_test”
CD to folder and
ogr2ogr -overwrite -f “MSSQLSpatial” “MSSQL:Server=z;Database=_GIS_Test;UID=xxx;PWD=yyy" bridges.shp a_srs EPSG:4326 -t_srs EPSG:28354 -nln “MGM_Bridges_test”
3.
ogr2ogr -overwrite -f “MSSQLSpatial” “MSSQL:Server=z;Database=_GIS_Test;UID=xxx;PWD=yyy" a_srs EPSG:4326 -t_srs EPSG:28354 -nln bridges.shp “MGM_Bridges_test”
ogrinfo on the input dataset opens it.
I have checked many posts here but no one reports this issue. Tried bridges.shp in quotes. I have removed the "“MGM_Bridges_test”" and I get the error No Target Datasource provided.
---- UPDATE
I tried typing the following but still get the same error...
-f MSSQLSpatial
gdal.org/drv_mssqlspatial.html. Do you really want to create a layer named "bridges.shp" as you now do with your -nln? -a_srs and -t_srs are not supposed to be used together.--debug on
to your command may give more information.src_dataset_name
that are shown in the usage to be expected before. Try ordering these arguments in the way shown in the usage."x"
rather than fancy quotes“x”
.