After installing VS2015, SQL Server can no longer call the ToString () method for the CLR type of the CLID hierarchy - for some values, it works, and for others it raises the following exception:
.NET Framework error while executing custom routine or cumulative "hierarchy": Microsoft.SqlServer.Types.HierarchyIdException: 24000: SqlHierarchyId failed because the HierarchyId object was created from an invalid binary string.
This is easy to reproduce by running the following simple query:
select OrganizationNode.ToString () from HumanResources.Employee
I tried to remove .NET 4.5.3, but that did not help. Any known workarounds? Trying to execute the CAST hierarchyid value for VARCHAR led to the same error, so I assume it calls ToString () under the hood.
source share