Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Geography data type error

Status
Not open for further replies.

G12Consult

Programmer
May 12, 2016
77
AU
I have a field in a table with the geography data type.

I can write to the field using a lat & long reference which gives me a value of: 0xE6100000010CF4F8BD5D7F063CC059349D9D0C2A6340

When I try to extract the lat out of that field using
Code:
SELECT GEOLOCATION.LONG
, I receive the error:

Code:
Could not find property or field 'long' for type 'Microsoft.SqlServer.Types.SqlGeography' in assembly 'Microsoft.SqlServer.Types'.

I thought this should work?
 
Have you tried:

Code:
Select	GEOLOCATION.Longitude
From	YourTable

Sample from here


---- Andy

There is a great need for a sarcasm font.
 
This worked though

Code:
SELECT geolocation.Lat as Lat, geolocation.Long as Lon from INVESTOR.PROPERTIES

I read something about case sensitivity regarding spatial data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top