I am trying to create and insert data from ESRI shape files. This is one of the many features in the shape file, you can copy paste it and try it yourself:
DECLARE @g geography; SET @g = geography::STPolyFromText('POLYGON ((28.397422886819093 70.5432251792964, 28.570915861286892 70.512498993109844, 28.540819573464251 70.4456402666085, 28.486718688957893 70.433538619104056, 28.353077926613448 70.512911092846991, 28.397422886819093 70.5432251792964))', 4326); SELECT @g.ToString();
If I try to create a geography object from this on SQL Server 2008, it fails with the following error:
Msg 6522, Level 16, State 1, Line 2 A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.ArgumentException: 24200: The specified input does not represent a valid geography instance. System.ArgumentException: at Microsoft.SqlServer.Types.SqlGeography.ConstructGeographyFromUserInput(GeoData g, Int32 srid) at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)
What is wrong with this shape?