Geography 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.
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.
- Geography
- 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 declare a variable as a geometry data type.
Example
With geography data type
DECLARE @Shape geography = 'POLYGON ((3 -6, 8 -2, 2 5, -2 0,3 -6))'
SELECT @Shape
|
Output: