Geography

IF OBJECT_ID ( 'dbo.SpatialTable', 'U' ) IS NOT NULL 
DROP TABLE dbo.SpatialTable; 
GO
CREATE TABLE SpatialTable 
( 
id int IDENTITY (1,1), 
GeogCol1 geography, 
GeogCol2 AS GeogCol1.STAsText() 
); 
GO 
INSERT INTO SpatialTable 
(GeogCol1)
VALUES 
(geography::STGeomFromText('LINESTRING(47.656 -122.360, 47.656 -122.343)', 4326)); 

INSERT INTO SpatialTable 
(GeogCol1) 
VALUES 
(geography::STGeomFromText('POLYGON((47.653 -122.358, 47.649 -122.348, 
47.658 -122.348, 47.658 -122.358, 47.653 -122.358))', 4326)); 
GO
Advertisements