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 both a Registered Nurse and a Microsoft SQL Server MVP 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. Experienced in systems integration and workflow analysis, John is passionate about combining his IT experience with his nursing background to solve difficult problems in healthcare. He sees opportunities in using business intelligence and Big Data to satisfy healthcare meaningful use requirements and improve patient outcomes. Contributing author to SQL Server MVP Deep Dives
and SQL Server MVP Deep Dives Volume 2