SQL 2008 geography data type
Posted: Fri Feb 11, 2011 9:42 am
I am building a datastage job to populate a SQL Server 2008 target DB and the table has a Geography data type for a geospatial value from the latitude / longitude fields. I'm trying to figure out how to write the upsert statement to calculate and store the value. Below is the SQL statement if I were to run an update on the field to calculate the value after the record is inserted, but hoping there is a way to calculate as I'm updating or inserting the record.
geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS VARCHAR(20)) + ')', 4326)
Thanks for any assistance,
JB
geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS VARCHAR(20)) + ')', 4326)
Thanks for any assistance,
JB