Greetings. Just simple script, which someone can find handy. It will do exactly as description said - convert GPS from decimal format to format known as DMS (date-minute-second) .
There are two paramatres
- @decimalGPS is decimal(20,8) value containg decimal GPS coordinates
- @isLongitude is bit value expressing whether we are dealing with latitude or longitude
I believe script is self-explaining. The queries are separated, althought they could be probablly shrinked into one, but i preffer readibillity of script before having all written in one row.
SELECT dbo.gpsConvertDecimalToDMS(50.4942,0), dbo.gpsConvertDecimalToDMS(14.4481,1)