Solved

create a hierarchial table structure

Posted on 2014-09-23
2
119 Views
Last Modified: 2014-09-24
I have a simple account table.  How do you create a hierarchial table structure for accounts that just goes 1 level deep?

So, you can have a parent account and then child accounts underneath the parent.

Thanks for any help.
Regards.
0
Comment
Question by:-Dman100-
2 Comments
 
LVL 6

Accepted Solution

by:
ianmills2002 earned 500 total points
ID: 40340770
Two options.

1. A 2nd Parent account table and all the accounts in the account table have a foreign key to link to the parent.

2. Keep them all in the same table and add a Parent Account column. When NULL, the account record is a parent, when NOT NULL, the account has a parent account.
0
 

Author Closing Comment

by:-Dman100-
ID: 40341663
Thank you!
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now