Transforming Latitude and Longitude into Geography SQL Server Type

SQL Server 2008 provides support for spatial data and many accompanying functions. SQL Server Reporting Services 2008 R2 has a built in support for maps (SHD files or even bing maps). There is a handy wizard in Report Builder 3.0 that will guide you through through the report creation process with map. If you want to use Bing Maps you have to have a Geography type in your SQL datasource somewhere.

I recently faced a situation where the customer had the Lat & Long coordinates of the spots which should be plotted in a map. In order to convert lat & long in Geography type use the following T-SQL:

geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(10)) + ' ' +
CAST([Latitude] AS VARCHAR(10)) + ')', 4326)

Then you have the option of using the Bing maps in your SSRS reports.