SQL Training Online

  • Training Courses
  • Beginner Book
  • Blog

August 30, 2017 by Joey Blue 1 Comment

Latitude and Longitude with the Geography Data Type – SQL Training Online

The Geography data type is used in many different SQL Server databases. It contains Latitude, Longitude, and many other properties and functions.

In this video I show you how to extract the latitude and longitude from the Geography data type.

Video: Latitude and Longitude with the Geography Data Type


How to extract the latitude and longitude from the Geography data type..

I use the Wide World Importers and the following scripts:

--SQL Geography Data Type
select CityName
,Location.Lat Latitude
,Location.Long Longitude
,cast(location as varchar(max))
from Application.Cities

Link to the a good tutorial on MSSQLTips.com.

 

See the original Latitude and Longitude in SQL Server video.

Related

Filed Under: SQL Tip Tagged With: Latitude, Longitude, SQL Cast, SQL Geography, SQL Server

Comments

  1. António José Campos says

    February 19, 2019 at 11:20 pm

    Hi. I have one code that I think it’s one of those, but I don’t have SQL Server or any similar. could you please check? 0xE6100000010C9E7CF5DE05EF31C0AA9137D3978C51C0

    Many thanks.

    Reply

Leave a Question, Comment, or Reply. All are welcome!Cancel reply

Recent Posts

  • SQL Database Normalization – 1NF, 2NF, 3NF, and 4NF
  • SQL Joins Tutorial for Beginners – Inner Join, Left Join, Right Join, Full Outer Join – SQL Training Online
  • Zillow House Price Analysis from CSV Archive – #PowerBI 002
  • Learn Basic SQL – 1 Hour Training Course – SQL Training Online
  • Create Table Statement in SQL Server and Inserting Baseball Homerun Leader Dataset – SQL Training Online

Popular Posts

  • SQL Functions
  • SQL Jobs in Oracle and Microsoft SQL Server
  • Troubleshooting a SQL Join
Copyright © 2025 · SQLTrainingOnline.com · Consulting at EmbarkBlue.com