Search code examples
sql-serversqlgeography

Using the SQL Server Geography data type


I am working with a SQL Server database that has a customer table in it that contains (among other things) an address column. This column houses the full address (street, city, state, zip) as one long text string. We are looking to convert this information into latitude & longitude coordinates for plotting on a map. I've been looking into using the Geography data type in SQL Server, but I cannot find any definitive information regarding what data actually needs to be entered into the Geography column in the database table.

The question I have: is there a way to use the Geography data type to convert the address string (or any part of it, City, Zip, etc.) into latitude & longitude coordinates?


Solution

  • For what you're looking to do, you'd need latitude and longitude information. The data type doesn't convert addresses inherently, but there are many services that you can use to do that.