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

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Sending parameters to stored procedures vb.net(将参数发送到存储过程 vb.net)
Insert multiple rows, count based on another table columns(插入多行,根据另一个表列计数)
How to hold the location of an image in a SQL Server database?(如何在 SQL Server 数据库中保存图像的位置?)
How to send to email (outlook) the selected items in SQL Server database using vb.net(如何使用 vb.net 将 SQL Server 数据库中的选定项目发送到电子邮件(Outlook))
datagrid checkbox writes Null instead of 0 (false) into database(datagrid 复选框将 Null 而不是 0 (false) 写入数据库)
DBCC CheckDb-any ways to detect errors vb.net?(DBCC CheckDb-vb.net 有什么检测错误的方法吗?)