Visual Studio 2015 Preview breaks SQL Server hierarchyid

强颜欢笑 提交于 2019-12-12 13:55:52

问题


After installing VS2015, SQL Server can no longer call ToString() method for hierarchyid CLR type - for some values it works, for others it throws the following exception:

A .NET Framework error occurred during execution of user-defined routine or aggregate "hierarchyid": Microsoft.SqlServer.Types.HierarchyIdException: 24000: SqlHierarchyId operation failed because HierarchyId object was constructed from an invalid binary string.

This is easily reproduced by running the following simple query:

select OrganizationNode.ToString() from HumanResources.Employee

I tried uninstalling .NET 4.5.3, but it didn't help. Any known workarounds? Trying to CAST the hierarchyid value to VARCHAR resulted with the same error, so I assume it calls ToString() under the hood.


回答1:


Visual Studio 2015 CTP6 fixes this.

Edit: Changed CTP5 (which did fix it for a short while) to CTP6, which fixes it permanently for me.



来源:https://stackoverflow.com/questions/27588948/visual-studio-2015-preview-breaks-sql-server-hierarchyid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!