SQL Server latitude and longitude data type

DECIMAL(9,6) is what I normally use for both. If you need more precision, then try DECIMAL(12,9).

You could also use the GEOGRAPHY data type, but it will take more space, and I would only recommend this if you need SQL Servers spatial features (indexing etc).

For the actual conversion, try this:

CAST(@YourLat AS DECIMAL(12,9))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)