THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

SQL Server 2008 Spatial Data - Getting Started

There are all kinds of cool things you can do with SQL Server 2008 spatial data. A lot of people know that, but not that many have gotten started. Don't put it off, you can get started today using SQL Server 2008 R2 Express. It's simple to get started. Here's how to take your first baby steps:

  1. Download and install SQL Server 2008 R2 Express. (Do a search using sql server 2008 r2 express download as your search string.)
  2. Do a spatial query. You'll need to find a spatial data column. How do you do that? The easiest way is to check the system metadata.

    select *
    where DATA_TYPE like 'geo%'

  3. The query reveals that the Address table in the Person schema has a column named SpatialLocation with a data type of geography.
  4. Issue a simple query against the table.

    select * from Person.Address
  5. Notice the Spatial results tab. Select the Robinson projection. So what does the map depict? The Person.Address table contains the addresses of employees and customers around the world. Although the viewer shows only the first 5,000 rows of the 19,614 addresses in the database, you can see that the addresses define the continental United States and the east coast of Australia somewhat. Because the mouse pointer is hovering over an address stored in the table, you see the details of the row in the box that's displayed over the map surface.


The series continues with part 2 here.

Published Saturday, October 18, 2008 1:36 AM by John Paul Cook



Sam said:

Why are the links no longer available?? ,im in need of help im just starting to learn about spatial maps

April 28, 2011 6:48 AM

John Paul Cook said:

The post was published on October 18, 2008. Things have changed. I updated the post by removing the links and providing search instructions so that you'll find what is current.

April 30, 2011 11:13 AM

jagetheesh said:

your SQL  posting is very nice. How can i used geometry data types in sqlserver and oracle for create and insert statement. please help me and also help for how can convert to COGNOS if you know.It is very urgent.

Thanks & Regards


June 22, 2012 6:43 AM

jagetheesh said:

please give your suggestion in my mailid :

Thanks & Regards


June 22, 2012 6:46 AM
Anonymous comments are disabled

About John Paul Cook

John Paul Cook is a database and Azure specialist in Houston. He previously worked as a Data Platform Solution Architect in Microsoft's Houston office. Prior to joining Microsoft, he was a SQL Server MVP. He is experienced in SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a registered nurse recently completed the education to become a psychiatric nurse practitioner. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog



Privacy Statement