column type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Godfrey

    column type

    I am putting together a SQL table which will hold a latitude and
    longitude for each record. An example of a latitude is: 47 05 36.5
    Which column type would best represent this and retain the spaces
    between degrees, minutes, seconds? Text, varchar, char?

    Thanks
    Jeff

    jeff-godfrey@wa.nacd net.org
  • Gert-Jan Strik

    #2
    Re: column type

    Don't use Text. Text is only useful for large texts and needs special
    treatment.

    Since the variability in value length will be small I would opt for the
    char datatype. Other than that varchar is a fine choice as well. If you
    choose char, make sure you don't overdimension it (you would waste
    space).

    Gert-Jan


    Jeff Godfrey wrote:[color=blue]
    >
    > I am putting together a SQL table which will hold a latitude and
    > longitude for each record. An example of a latitude is: 47 05 36.5
    > Which column type would best represent this and retain the spaces
    > between degrees, minutes, seconds? Text, varchar, char?
    >
    > Thanks
    > Jeff
    >
    > jeff-godfrey@wa.nacd net.org[/color]

    Comment

    • Anith Sen

      #3
      Re: column type

      Unless you are doing any computations on the values in this column, you can
      use CHAR datatype. If each portion of this data has operational significance
      or need any computations, you may be better off storing them as separate
      numeric columns.

      --
      - Anith
      ( Please reply to newsgroups only )


      Comment

      • --CELKO--

        #4
        Re: column type

        >> a latitude and longitude ... Which column type would best
        represent this and retain the spaces between degrees, minutes,
        seconds? Text, varchar, char? <<

        If you have to compute with them, you might want to use FLOAT and
        convert things to radians, and display them with a UDF.

        Comment

        Working...