Search code examples
sqlt-sqlgeolocationssrs-2008geo

SQL : Geolocation


I have a table with vendors and areas they serve: -some vendors serve a zip code -some serve a whole county -some serve a whole state I am trying to generate the geolocation for all of them to then use that on an SSRS map. I was so far able to get the geolocation for the state but not for the other ones using the following query:

ALTER TABLE myTable ADD geolocation geography

example:

  UPDATE myTable SET geolocation = 'POINT(-85.972173  31.809675)' WHERE ZipCode = 36081 

but that only works for the vendors that have a zipcode. the other ones have all in the zipcode column.

Could anyone help solve this problem, Thank you in advance.


Solution

  • Other vendor who are handling ewntire state /country, you can add Polygon geolocation..

    Check this link out if this helps:

    https://www.simple-talk.com/sql/t-sql-programming/introduction-to-sql-server-spatial-data/