Visual Studio 2015 Preview breaks SQL Server hierarchyid(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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Visual Studio 2015 预览版打破了 SQL Server 层次结构


- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01