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:
- Download and install SQL Server 2008 R2 Express. (Do a search using sql server 2008 r2 express download as your search string.)
- 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.
where DATA_TYPE like 'geo%'
- The query reveals that the Address table in the Person schema has a column named SpatialLocation with a data type of geography.
- Issue a simple query against the table.
select * from Person.Address
- 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.
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
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 clinics that treat low income patients. 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.