Thursday, July 24, 2008

HIERARCHYID Error: Could not find method 'IsDescendant'

You might get the following error while working with HIERARCHYID data types in RC0:

Could not find method 'IsDescendant' for type 'Microsoft.SqlServer.Types.SqlHierarchyId' in assembly 'Microsoft.SqlServer.Types'

The IsDescendant() method of HIERARCHYID data type is renamed to IsDescendantOf() in RC0. To correct the error, change parent.IsDescendant(child) to child.IsDescendantOf(parent). This is documented at http://download.microsoft.com/download/4/9/e/49eeb41a-a769-4520-80d6-671b8ae2bd06/ReleaseNotesSQLServer2008.htm

Also note that the method names are case sensitive.

0 comments: