What's the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?

Jonathan picture Jonathan · Feb 16, 2009 · Viewed 120k times · Source

I'm designing a table in SQL Server 2008 that will store a list of users and a Google Maps co-ordinate (longitude & latitude).

Will I need two fields, or can it be done with 1?

What's the best (or most common) data-type to use for storing this kind of data?

Answer

dan90266 picture dan90266 · Nov 14, 2010

Fair Warning! Before taking the advice to use the GEOGRAPHY type, make sure you are not planning on using Linq or Entity Framework to access the data because it's not supported (as of November 2010) and you will be sad!

Update Jul 2017

For those reading this answer now, it is obsolete as it refers to backdated technology stack. See comments for more details.