Use of MsSqlServer Gemotry Data Type

create database dbchink
use dbchink
create table tbchink
(eno int, ename varchar(50),esal int)
declare @g geometry
–set @g=geometry::STGeomFromText(‘Polygon((5 0,10 5, 5 10,0 5,5 0))’,0)
–select @g
declare @g geometry
set @g=geometry::STGeomFromText(‘Polygon((0 5,0 -5,5 10,10 5,0 5))’,0)
select @g
declare @g1 geometry
set @g1=geometry::STGeomFromText(‘Polygon((-10 0,0 14,14 0,-10 10,10 10,-10 0))’,4326)
select @g1
–declare @g geometry
–set @g=geometry::STGeomFromText(‘Point(1 0)’, 0)
–set @g=geometry::STGeomFromText(‘LineString(0 0,5 0)’, 0)
declare @g geometry
set @g=geometry::STGeomFromText
(‘MultiLineString((0 0,5 0),(0 0,0 5),(0 5,5 5),(5 0,5 5),
(2 2,7 2),(2 2,2 7),(2 7,7 7),(7 2,7 7),
(0 5,2 7),(5 5,7 7),(5 0,7 2),(0 0,2 2)
,(0 5,-2 9),(2 7,0 11),(-2 9,0 11)
,(5 5,3 7),(7 7,5 11),(3 7,5 9)
,(-2 7,3 7),(0 9,5 9)
,(-2 7,3 7),(0 9,5 9)
,(-4 5,-2 9),(-4 0,-4 5)
,(0 0,-4 0)
,(0 5,-4 5)
)’, 0)
declare @g geometry
set @g=geometry::STGeomFromText
(‘MultiLineString((0 0,5 0),(0 0,0 5),(0 5,5 5),(5 0,5 5))’,0)select @g
declare @g geometry
set @g=geometry::STGeomFromText(‘MultiLineString((2 1, -3 -3), (-3 -3, 3 -3),(3 -3,
-2 1),(-2 1,0 -5),(0 -5,2 1))’,0)
select @g

create database dbchinkuse dbchinkcreate table tbchink(eno int, ename varchar(50),esal int)
declare @g geometry–set @g=geometry::STGeomFromText(‘Polygon((5 0,10 5, 5 10,0 5,5 0))’,0)–select @gdeclare @g geometryset @g=geometry::STGeomFromText(‘Polygon((0 5,0 -5,5 10,10 5,0 5))’,0)select @g
declare @g1 geometryset @g1=geometry::STGeomFromText(‘Polygon((-10 0,0 14,14 0,-10 10,10 10,-10 0))’,4326)select @g1

–declare @g geometry–set @g=geometry::STGeomFromText(‘Point(1 0)’, 0)–set @g=geometry::STGeomFromText(‘LineString(0 0,5 0)’, 0)declare @g geometryset @g=geometry::STGeomFromText(‘MultiLineString((0 0,5 0),(0 0,0 5),(0 5,5 5),(5 0,5 5),(2 2,7 2),(2 2,2 7),(2 7,7 7),(7 2,7 7),(0 5,2 7),(5 5,7 7),(5 0,7 2),(0 0,2 2),(0 5,-2 9),(2 7,0 11),(-2 9,0 11),(5 5,3 7),(7 7,5 11),(3 7,5 9),(-2 7,3 7),(0 9,5 9),(-2 7,3 7),(0 9,5 9),(-4 5,-2 9),(-4 0,-4 5),(0 0,-4 0),(0 5,-4 5))’, 0)

declare @g geometryset @g=geometry::STGeomFromText(‘MultiLineString((0 0,5 0),(0 0,0 5),(0 5,5 5),(5 0,5 5))’,0)select @g

declare @g geometryset @g=geometry::STGeomFromText(‘MultiLineString((2 1, -3 -3), (-3 -3, 3 -3),(3 -3,-2 1),(-2 1,0 -5),(0 -5,2 1))’,0)select @g

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s