I have a GIS feature class of lines in a file geodatabase that I want to export directly to SQL Server. I only have ArcMap 10.0 to view this file and I can't see how it is possible using that. Usually, I export to shapefile and then upload from there but this is over 2Gb so I want to do it directly.
I already have the database set up in SQL Server, I just want to export directly from ArcMap and create a new table in SQL.
Is this possible?
I have tried using the Feature Class to Feature Class tool, and create a new Database Connection. If I test the connection, it works fine, however when i save the new Database Connection it has a little red cross next to it and still doesn't work. Any ideas?
-
Can you please explain what exactly are you trying to achieve? I have a hard time understanding what is your problem.Alex Tereshenkov– Alex Tereshenkov2018年03月15日 16:00:08 +00:00Commented Mar 15, 2018 at 16:00
-
@AlexTereshenkov - I just want to export a table of lines from a file geodatabase to SQL Server?al_sweets– al_sweets2018年03月15日 16:04:00 +00:00Commented Mar 15, 2018 at 16:04
-
desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/… should workAlex Tereshenkov– Alex Tereshenkov2018年03月15日 16:08:39 +00:00Commented Mar 15, 2018 at 16:08
-
2ArcGIS 10.0 isn't going to connect to any database released this decade. Please Edit the question to specify the exact versions of all software (including service packs)Vince– Vince2018年03月15日 22:35:40 +00:00Commented Mar 15, 2018 at 22:35
-
1Note that the answer to 99% of "Is this possible?" questions is "Of course, with a bit of work" (the remainder are "a lot of work" and "an awful lot of work").Vince– Vince2018年03月16日 02:15:58 +00:00Commented Mar 16, 2018 at 2:15
1 Answer 1
As said, there is no one-click tool to achieve this within ArcGIS or ArcGIS Pro standard packages.
GDAL and its OGR2OGR tool can be used to transfer shapefiles to MS SQL Server relatively painlessly and without writing code.
So export to a shapefile, then execute the following from a shell script:
ogr2ogr -f "MSSQLSpatial" "MSSQL:server=localhost;database=<database name>;trusted_connection=yes;" "my_exported_shape_file.shp" -progress
The ogr2ogr documention documents many additional arguments.
In the spirit of the question, a quick but dirty way of building this into a tool in ArcGIS would be to have a python script export to a shapefile, then generate and execute an OGR2OGR shell call.
After that there would be many options of mediating data transfer through many Python packages, like PySQL, SQLAlchemy and GeoPandas, or working natively with WKT formats to transfer spatial data.
-
If the shapefile would be larger than 2GiB, this isn't going to work, since, if it's larger than 2GiB, it isn't a shapefile.Vince– Vince2025年06月06日 11:38:34 +00:00Commented Jun 6 at 11:38
Explore related questions
See similar questions with these tags.