locked
Upload Shapefiles to SQL server 2005 RRS feed

  • Question

  • How can i upload ShapeFiles into SQL Server 2005, I have downloaded SQL Spatial Tool and shp2sql tools from the Microsoft site but not able to Upload these files in to the database

    Please suggest me a solution

    Wednesday, June 30, 2010 12:13 PM

All replies

  • Hello,

    MS SQL Server 2005 do not support spatial data types, that's a new feature of MS SQL 2008. So you can't use that tool wit 2005.

    To test it you could download & install the free MS SQL Server 2008 R2 Express Edition.


    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    • Proposed as answer by Tom Li - MSFT Friday, July 2, 2010 11:41 AM
    Wednesday, June 30, 2010 2:19 PM
  • See newbie question


    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    • Proposed as answer by Tom Li - MSFT Friday, July 2, 2010 11:41 AM
    Wednesday, June 30, 2010 2:47 PM
    Answerer
  • I have Installed SQL server 2008 and Imported my shapefiles in to the database. Now How can i access these shape files in my silverlight Application. In sql in after running query it is displaying the map, the exact thing i have to do in my silverlight App.

    Please suggest me some Samples/Approach

    Thursday, July 1, 2010 9:22 AM
  • The spatial results tab is only for use in SQL Server Management Studio. To create maps in Silverlight, try something like DeepEarth: http://deepearth.codeplex.com/

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    • Proposed as answer by Tom Li - MSFT Friday, July 2, 2010 11:41 AM
    Thursday, July 1, 2010 9:44 AM
    Answerer
  • Iam unable to upload some of the shapefiles into sql server 2008 db, my Lead says that you need to convert the shape files into sql server 2008 supportive format.

    What are the several reasons for not getting uploaded, iam not getting any error but table is not created in the database.

    is there any thing to convert shapefiles to sql 2008 supportive format.

    Someone provide me info on this.

     

    Thnku

    Sathish babu k

    Thursday, July 1, 2010 11:10 AM
  • I use Shape2SQL to upload shape files and it works pretty fine, no need to convert anything.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Thursday, July 1, 2010 11:29 AM
  • Iam also using Shape2SQL tool, but only one map im able to upload.

    remaining maps are not giving any errors but there is no table created in the DB.

    What could be the reason,  if you want the file please provide me your email ID i will send it.

     

    Thursday, July 1, 2010 11:47 AM
  • Hi,

    Can you please send this tool to me as the website doesn't seem to work. My mail id is Abhijeet.send2me@gmail.com

    Thanks a ton.

    Sunday, July 25, 2010 5:05 AM
  • I am also unable to reach the Shape2SQL site.  Is there an alternative?  http://www.sharpgis.net/page/shape2sql.aspx
    Sunday, July 25, 2010 5:04 PM
  • Morten Nielsen is aware of the website problem, but I believe he is on vacation.  He has made a comment about this on Twitter .
    Thursday, July 29, 2010 1:25 PM
  • What you can do is install the SQL2008 express edition locally, import your shapefiles into that and then copy your shapes from there into your sql2005 database as well known text or binary. I would then suggest adding columns for bounding coordinates for faster querying. This is how we worked with spatial data in Azure before it had spatial support.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
    Saturday, July 31, 2010 9:35 PM
  • @Crakdkorn - Richard is answering the original question, which was asking how to get shapefile data into SQL Server 2005 . If you are running SQL 2008 already, then you simply need to use Shape2SQL.

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Friday, October 29, 2010 2:25 PM
    Answerer
  • Iam also using Shape2SQL tool, but only one map im able to upload.

    remaining maps are not giving any errors but there is no table created in the DB.

    What could be the reason,  if you want the file please provide me your email ID i will send it.

     

    Uncheck "Create Spatial Index" option
    Saturday, October 30, 2010 2:14 PM
  • I discovered the same to be true... try this template and create the table before you import. This one would be for Michigan, US

    ftp://ftp2.census.gov/geo/tiger/TIGER2007FE/26_MICHIGAN/

    CREATE TABLE [dbo].fe_2007_26081_template(
     [STATEFP] [int] NULL,
     [STATENS] [varchar](50) NULL,
     [SLDLST] [varchar](6) NULL,
     [SLDLIDFP] [varchar](6) NULL,
     [NAMELSAD] [varchar](50) NULL,
     [LSAD] [nchar](10) NULL,
     [LSY] [int] NULL,
     [MTFCC] [nchar](10) NULL,
     [FuncStat] [nchar](10) NULL,
     [ID] [int] IDENTITY(1,1) NOT NULL,
     [geom] [geometry] NULL
    ) ON [PRIMARY]

     

    • Edited by Crakdkorn Saturday, October 30, 2010 2:18 PM missed source in the original
    Saturday, October 30, 2010 2:17 PM