Geometry data type in SQL Server 2008

In this article I am going to explain how to various types of create shapes in SQL Server 2008.
  • 679

Introduction

In this article I am going to explain how to various types of create shapes in SQL Server 2008. We can create triangle, square, pentagon, etc in SQL Server 2008. There are two types of spatial data types that are used to store geometric.

  1. Geography
  2. Geometry

where Geography data type is used to store geodetic spatial data. and geometry is used to store planar spatial data.

Create shape in SQL Server 2008

For creating shape, we deaclare a variable as a geometry data type.

Example

With geometry data type

DECLARE @Shape geometry = 'POLYGON ((-20 -30, -3 -26, 34 -33, 20 -40, -20 -30))'
SELECT @Shape

Output:

shape.jpg

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.