How to Import Shapefile (.shp) Spatial Data into SQL Server 2008

1. Get your spatial data ready. If you’re just starting to work with spatial data and don’t have a handy .shp file, you can visit some of these sites which provide publicly available shapefiles:
http://www.vdstech.com/map_data.htm
http://wwwn.cdc.gov/epiinfo/script/shapefiles.aspx
http://www.mapcruzin.com/download-free-arcgis-shapefiles.htm
http://www.census.gov/geo/www/cob/bdy_files.html

2. Download the SQL Server Spatial Tools from ArcGIS, which include the Shape2SQL tool.


3. Once downloaded, launch the Shape2Sql.exe file.

4. Fill in the fields required for database, table etc. However DO NOT check in the “Create Spatial Index” (as of Version 1.3.3759). It seems that when you click on this, the table does not get created in SQL Server.

shape2sql

5. Check your database, you should now have the new table you’ve specified in Shape2SQL, which contains the spatial data included in your shapefile.

6. If you select the data from this table in SQL Server Management Studio, you should see a new result tab called Spatial Results once you execute your query:

spatialquery spatialresults

Advertisements

3 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s