ARTICLE

How to Add World Map in SQL Server 2012

Posted by Vipendra Verma Articles | SQL Server August 22, 2012
This article explains how to add world map in SQL Server 2012.
Reader Level:

Introduction

This article explains how to add world map in SQL Server 2012. You can add world map in SQL Server 2012 and search or find any location using SQL statement. This feature is very useful for a global application.

Using this feature we can find any city, state or county. You can add world map based on administrative area, political point and ocean seas.

To add a world map to your SQL Server you need to add a file. To download this file click here. Download this file and extract it. You will find the file as given below.

Clipboard11.jpg

After doing that you need to also download the SQL spatial tools. To download the SQL spatial tools click here. This tool is used to convert a shape file to a SQL table. Download this tool and run the exe file.

Now you need to add a shape file using browse button and enter server name then click on the configure button to add some other detail. Here you need to add server name, choose login type, login name, password and database. After entering all information click on ok.

Clipboard13.jpg

Clipboard15.jpg

Now click on Upload Database to upload the file in SQL Server 2012.

Now start your SQL Server 2012 and execute the following statement.

Statement that execute world map in SQL Server 2012:

SELECT * FROM world

Output

Clipboard18.jpg

Statement that executes a map of a country (India) in SQL Server 2012:

SELECT * FROM world WHERE code_desc ='india'

Output

Clipboard19.jpg

Statement that executes a map of a country (Japan) in SQL Server 2012:

SELECT * FROM world WHERE code_desc ='japan'

Output

japan.jpg

Statement that executes a map of a State (Delhi) in SQL Server 2012:

SELECT * FROM world WHERE name='delhi'

Output

Clipboard02.jpg

Statement that executes a map of Asia in SQL Server 2012:

SELECT * FROM world WHERE class_desc ='asia'

Output

Clipboard05.jpg

Statement that executes a map of Europe in SQL Server 2012:

SELECT * FROM world WHERE class_desc ='europe'

Output

europe.jpg

COMMENT USING