Questions tagged [hierarchyid]

hierarchyid is a TSQL extension available from SQL Server 2008 to map hierarchical structures in a flat table. It supports in-order-sorting, get-descendant and level-queries

hierarchyid is a TSQL extension available from SQL Server 2008 to map hierarchical structures in a flat table. It supports in-order-sorting, get-descendant and level-queries

152 questions
0
votes
1 answer

How do I build a c# treeview from SQL Hierarchyid?

I'm developing an C# .NET Windows Form application that 'll manage a hierarchical tree-view structure. (I have a single SQL table with a hierarchyid column. The data set is small ~300 rows/nodes at the moment, but is bound to grow large…
yamn2
  • 71
  • 1
  • 1
  • 4
0
votes
1 answer

Odd Error Using HierarchyID with VB

Ignore all this and see the Update below In SS 2016 I have a simple table as follows: ID int indentity Code hierarchyid Name varchar(50) In my VB application I try to read the data as follows: Imports System.Data Imports…
SezMe
  • 527
  • 8
  • 24
0
votes
1 answer

NHibernate hierarchyid SQL Server 2014

I am using NHibernate with mapping by code, connected an SQL Server. This server also contains file tables. The customer, for whom I develop, has an SQL Server 2012, which I also had for quite a while. Due to a recent error in the VM running my…
0
votes
1 answer

Can I do a DAG with SQL Server HierarchyId?

I'm developing an organizational chart in SQL Server 2016. I have some employees report to multiple managers which make the data structure a Directed Acyclic Graph. How can I design the employee table with employee to have multiple managers are…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
0 answers

SQL Server hierarchyid Vs Closure Table

I'm implementing a organizational chart in SQL Server 2016 as a hierarchical structure. I have to do read, insert, update on the tree. I also have to get the subtree faster. I looked at few different ways to implement this. The first and foremost, I…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
1 answer

Shifting hierarchyid set

I have a table that contains a set of values and a hierarchyid column. Looks something like this: +-----+-------------+-----------+ | ID | HierarchyID | Name | HierarchyID.ToString() for clarity +-----+-------------+-----------+ | 1 | …
0
votes
0 answers

How to create an hierarchy of list of nodes of a graph?

I want to create a TreeView in which i store all nodes of my graph. when i modify the name of the nodes, i want this name be update on my treeview...But i don't know how to process can you help me please? I try to add the name of the node when i am…
0
votes
1 answer

SQL Server Hierarchy ID search for records and include all related parents in result

I've got a Product Category table set up using a SQL Server hierarchy id, I'd like to create an auto-complete dropdown in a CMS that returns searches for matching categories but rather than just displaying the matching category name also displays…
Rob
  • 10,004
  • 5
  • 61
  • 91
0
votes
1 answer

Ordering in dropdown in MVC

I've a problem with a dropdown in a view in MVC. The option-elements in the dropdown comes from a table and should be ordered by a hierarchyId column. I've made a view which orders correctly, but when I create my entity from the view and use it for…
0
votes
1 answer

Query for parents and top two children of a hierarchyID table

I'm trying to get the Parent and its top left and top right children from a single table that uses HiearchyID. Been banging my head on it for weeks and would appreciate any help. It's a single table that stores 'facts' for a school debate team, each…
Jason
  • 396
  • 1
  • 3
  • 17
0
votes
1 answer

Get last child from sql hierarchyid

I have hierarchyid in my tables like this. /1/ - This is Category /1/1/ - This is SubCategory /1/1/1/ - This is Item /1/1/2/ - Item /1/1/3/ - Item /1/2/ - SubCategory /1/2/1/ - Item /1/2/2/ - Item /1/2/3 - Item I want to get the last child…
Yesudass Moses
  • 1,841
  • 3
  • 27
  • 63
0
votes
0 answers

HierarchyId: mapping in native entity framework code first

I'm trying to define my schema using code-first fluent configuration, and I'm running into a problem while configuring a column type hierarquyId. I´m try define with Microsoft.SqlServer.Types.SqlHierarchyId. not success. Suggestions? How use…
0
votes
1 answer

HierarchyID in .NET Dataview

Code previously worked, but installing on new PC where it does not. Probably missing a setting? Using Visual Studio 2013 Professional. SQL Server 2012 has db table with hierarchyID field, but it has NULL values. This table is queried into a…
David A Stumpf
  • 753
  • 5
  • 13
0
votes
1 answer

How to get the child nodes from a parent node from a table in SQL?

Say I have the following hierarchical representation in my database: A |_B_C |_D then I want to get the child nodes from A (or B). and vice versa, I want to get the parent from a given child node? <> CREATE TABLE tbl ( Node HierarchyID PRIMARY…
user4451265
0
votes
1 answer

Does ServiceStack ORMLite support HierarchyId at this point?

I am looking at this post which is probably not as updated: SQL Server specific types support for OrmLite However, I am trying to see if it is supported currently. If not, what is the best way to support these kind of "not so usual" types while…
Lost
  • 12,007
  • 32
  • 121
  • 193