Summary: This article describes the issue occurred with execution of the a polygon instance of the geography type and the possible solution for it.
Once I stumbled upon the following query:
DECLARE @g1 GEOGRAPHY;
SET @g1 = geography::Parse(‘POLYGON ((0 0, 1 0, -1 1, 2 2, 0 0))’);
The query seemed to be quite valid and SSMS executed it smoothly, but nevertheless dbForge Studio for SQL Server failed to execute it.
In SQL server Management Studio 2014, the query after execution returns the following binary serialized instance of the Geography data type:
During deserialization of the aforesaid value, dbForge Studio threw an exception, and I was destined to get to the bottom of the issue. Making no question of the value validity, I decided to write a test .NET application to localize the problem.