Select to view content in your preferred language

Importing Shapefiles to a mssql db

4380
5
02-06-2019 11:42 PM
TshepoHlako
Emerging Contributor

I used a for loop to loop through multiple directories where shapefiles are saved and print them. I need to therefore import these shapefiles to a mssql db. How do i achieve this?

0 Kudos
5 Replies
JoshuaBixby
MVP Esteemed Contributor

It starts with understanding Database connections in ArcMap—Help | ArcGIS Desktop.  You will need to create a database connection file to the MSSQL DB, so Esri tools can work with it.

0 Kudos
TshepoHlako
Emerging Contributor

this is the db connection string and db creation i have:

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

If you want to use ArcGIS to load the data, you will need to Create Database Connection—Help | ArcGIS Desktop.

If you simply want to load shape files into SQL Server and you are unfamiliar with ArcGIS, I suggest reading "Importing Data to SQL Server" section of OGR2OGR Patterns for SQL Server | Alastair Aitchison 

TshepoHlako
Emerging Contributor

What we're trying to do is cut out the process of loading 500Gb + of shapefiles every quarter to ArcGIS and from that to creating a sql db as a last stop as this was done manually. I'm going to read up on that article, hope it helps.

Thanks a lot Josh.

0 Kudos
TshepoHlako
Emerging Contributor

Hi Joshua,
That article by Alastair you suggested helped quite a lot, managed to get around the problem and can import to sql using commands he covers in it.

0 Kudos