1

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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Mar 15, 2018 at 15:57
11
  • Can you please explain what exactly are you trying to achieve? I have a hard time understanding what is your problem. Commented Mar 15, 2018 at 16:00
  • @AlexTereshenkov - I just want to export a table of lines from a file geodatabase to SQL Server? Commented Mar 15, 2018 at 16:04
  • desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/… should work Commented Mar 15, 2018 at 16:08
  • 2
    ArcGIS 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) Commented Mar 15, 2018 at 22:35
  • 1
    Note 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"). Commented Mar 16, 2018 at 2:15

1 Answer 1

0

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.

Vince
20.5k16 gold badges49 silver badges65 bronze badges
answered Dec 3, 2021 at 11:47
1
  • 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. Commented Jun 6 at 11:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.