THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - 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 *
    from INFORMATION_SCHEMA.COLUMNS
    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.

image

The series continues with part 2 here.

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

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

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

A.S.Jagetheesh.

June 22, 2012 6:43 AM
 

jagetheesh said:

please give your suggestion in my mailid : jagetheesh@gmail.com

Thanks & Regards

A.S.Jagetheesh.

June 22, 2012 6:46 AM

Leave a Comment

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is a Technology Solutions Professional for Microsoft's data platform and works out of Microsoft's Houston office. Prior to joining Microsoft, he was a Microsoft SQL Server MVP. He is experienced in Microsoft 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 who graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. He volunteers as a nurse at safety net clinics. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Opinions expressed in John's blog are strictly his own and do not represent Microsoft in any way.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement