SQL Error (6522) when selecting Data tab containing ESRI Shape data.

[expired user #9039]'s profile image [expired user #9039] posted 9 years ago in General Permalink
I get an error message when selecting the Data tab on certain tables in a MS SQL 11.0 database. The Table tab works. Executing the Query "SELECT TOP 1000 * FROM the-problem-table" works in the Query tab.
The same error occurs when executing the Query "SELECT TOP 1000 LEFT(CAST("Shape" AS NVARCHAR(256)), 256) FROM the-problem-table;"
The error does not occur when executing the Query "SELECT TOP 1000 "Shape" FROM the-problem-table;
"
This "Shape" column is a Geometry / geography type from ESRI which displays as a bunch of strange characters.

SQL Error (6522): A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry":
System.Data.SqlServer.TruncationException: Trying to convert return value or output parameter of size 840 bytes to a T-SQL type with a smaller size limit of 512 bytes.
System.Data.SqlServer.TruncationException:
at System.Data.SqlServer.Internal.CXVariantBase.StringToWSTR(String pstrValue, Int64 cbMaxLength, Int32 iOffset, EPadding ePad)

HeidiSQL 9.2.0.4947, 9.2.0.4961, 9.2.0.4971.
MS Win XP (32), MS Win Server 2008 R2 Enterprise (64).

Is there a solution to this problem?

Please login to leave a reply, or register at first.