Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2012 在SQL Server 2012脚本中找不到IsDescendatof方法-为什么?_Sql Server 2012 - Fatal编程技术网

Sql server 2012 在SQL Server 2012脚本中找不到IsDescendatof方法-为什么?

Sql server 2012 在SQL Server 2012脚本中找不到IsDescendatof方法-为什么?,sql-server-2012,Sql Server 2012,我是SQLServer2012新手,在运行这段代码之前,我一直做得很好,这段代码摘自微软的一本书。我一直在寻找解决办法,但却一无所获 非常感谢您提供的任何建议 DECLARE @AmyNodeId hierarchyid SELECT @AmyNodeId = NodeId FROM Employee WHERE EmployeeId = 46 SELECT NodeId.ToString() AS NodeIdPath, * FROM Employee WHERE Employ

我是SQLServer2012新手,在运行这段代码之前,我一直做得很好,这段代码摘自微软的一本书。我一直在寻找解决办法,但却一无所获

非常感谢您提供的任何建议

DECLARE @AmyNodeId hierarchyid

SELECT @AmyNodeId = NodeId
 FROM  Employee
 WHERE EmployeeId = 46

SELECT NodeId.ToString() AS NodeIdPath, *
 FROM  Employee
 WHERE Employee.NodeId.isDescendantOf(@AmyNodeId) = 1
 ORDER BY NodeLevel, NodeId
发出以下信息:

在程序集“Microsoft.SqlServer.Types”中找不到类型“Microsoft.SqlServer.Types.SqlHierarchyId”的方法“IsDescendatof”


Harvey

在我重新启动SQL Server 2014管理工作室后,这个问题自行解决了


混蛋

我也有同样的问题。原来
isdescendatof
区分大小写