2015-03-30 49 views
1

我是SQL Server 2012的新手,直到我運行從Microsoft書籍中獲取的這些代碼時,我的表現一直不錯。我尋找解決方案並沒有得到任何地方。isDescendantOf方法在SQL Server 2012腳本中找不到 - 爲什麼?

任何意見,你可以給非常感謝。在裝配 'Microsoft.SqlServer.Types'

找不到方法 'isDescendantOf' 類型 'Microsoft.SqlServer.Types.SqlHierarchyId':

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 

給出了這樣的消息!

Harvey

+2

我遇到了同樣的問題。原來'isDescendantOf'區分大小寫 – olivieradam666 2016-04-13 14:22:12

回答

0

在我重新啓動SQL Server 2014 Management Studio後自行修復。

臭蟲!

相關問題