Visual Studio 2015 预览版打破了 SQL Server 层次结构

Visual Studio 2015 Preview breaks SQL Server hierarchyid(Visual Studio 2015 预览版打破了 SQL Server 层次结构 ID)
本文介绍了Visual Studio 2015 预览版打破了 SQL Server 层次结构 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装 VS2015 后,SQL Server 无法再为 hierarchyid CLR 类型调用 ToString() 方法 - 对于某些值它有效,对于其他值它会引发以下异常:

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:

在执行用户定义的过程中发生 .NET Framework 错误常规或聚合层次结构":Microsoft.SqlServer.Types.HierarchyIdException: 24000: SqlHierarchyId操作失败,因为 HierarchyId 对象是从一个无效的二进制字符串.

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:

从 HumanResources.Employee 中选择 OrganizationNode.ToString()

select OrganizationNode.ToString() from HumanResources.Employee

我尝试卸载 .NET 4.5.3,但没有帮助.任何已知的解决方法?尝试将hierarchyid 值转换为VARCHAR 导致了同样的错误,所以我假设它在幕后调用了ToString().

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.

推荐答案

Visual Studio 2015 CTP6 修复了这个问题.

Visual Studio 2015 CTP6 fixes this.

将 CTP5(确实修复了一小段时间)更改为 CTP6,它为我永久修复.

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

这篇关于Visual Studio 2015 预览版打破了 SQL Server 层次结构 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)