Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Storing Latitude and Longitude in a SQL Server 2005 DB?

This is a discussion on Storing Latitude and Longitude in a SQL Server 2005 DB? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm working with SQL Server 2005 and have to store the Lat and Lng for updates coming into the server. ...

  1. #1
    OOT
    OOT is offline Junior Member Yellow Belt
    Join Date
    Dec 2006
    Posts
    19

    Storing Latitude and Longitude in a SQL Server 2005 DB?

    I'm working with SQL Server 2005 and have to store the Lat and Lng for updates coming into the server. I was initially thinking of storing them as VarChars but the Decimal option seems better. I've been searching the forums and either I'm using the wrong keywords or the information isn't posted but what I'm looking for are the maximum values that lat and lng can be? Should I define the data type as Decimal(12, or can I go smaller? I just want to make sure that once it's done I won't have to go back and change them so I want to account for whatever the highest/lowest combination is.

    Or do you think storing it as a VarChar(12) would be better?

    Thanks in advance for any and all help that you can give. It is very much appreciated.

  2. #2
    C72831 is offline Junior Member White Belt
    Join Date
    Jul 2003
    Posts
    9

    Re: Storing Latitude and Longitude in a SQL Server 2005 DB?

    I use Decimal(18,15) for storing them, since you need a high accuary (decimal places). Varchar is never a good choice for storing numbers.

    Bernhard
    Bernhard Heuschneider
    Zirl, Austria

  3. #3
    OOT
    OOT is offline Junior Member Yellow Belt
    Join Date
    Dec 2006
    Posts
    19

    Re: Storing Latitude and Longitude in a SQL Server 2005 DB?

    Quote Originally Posted by C72831 View Post
    I use Decimal(18,15) for storing them, since you need a high accuary (decimal places). Varchar is never a good choice for storing numbers.

    Bernhard
    Thank you for that. I thought going the varchar route would be a mistake. I didn't realize that the lat/lng number would be that high. Thank you for the information ... now I'm off to edit my database

  4. #4
    arun is offline Junior Member White Belt
    Join Date
    Mar 2009
    Posts
    1

    How to Store Latitude and Longitude in to SQL Server 2005 DB?

    Hello Every one.

    I am developing a property portal.I have a google map,where the user will be able to specify the location of his property.Once the user specify his exact area(logi and lati) i need to save the same longitude and latitude so that when a user search for a region say that is all ready registred with us,will get displayed with the same location pointing in google map as well.

    How can i store the selected longitude and latitude into my db?
    i am using asp.net and c# as the code behind.

    Or please tell me whether it is possible to directley store the selected area(latitude and longitude) in sql server 2005?

    Please help me as it is very urgent to me.
    Thank you all in advance.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Geocode your data directly from SQL Server 2005
    By Johannes Kebeck's Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-15-2007, 03:25 PM
  2. How to get latitude and longitude
    By ma2005pp in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-28-2005, 01:57 AM
  3. Latitude and Longitude
    By virgilar in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-21-2005, 01:01 PM
  4. Latitude and Longitude
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-25-2003, 12:52 PM
  5. NMEA latitude/longitude and mappoint latitude/longitude
    By muurman in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 11-22-2003, 04:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27