Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Relationship in tables and table itself

Author  Topic 

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-08-08 : 08:22:32
Hi Guys,

I am doing some work with parent and child as tree view

so I have a table which has got ParentID, Name, and ChildID.

I have data as

1 parentA 1
2 ParentB 2
3 childA 1
4 childC 2



I want to view these data as

parentA
ChildA
ParentB
ChildB
ChildC ( ChildC is a child of ChildB)



Can I have relationship in same table with ParentID and ChildID. Or do I need to have two tables. I will be grateful if someone explains me this .............

Thanks,
LearnEveryDay

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-08 : 09:00:45
Do you need something like this?
http://sqlteam.com/forums/topic.asp?TOPIC_ID=43485

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

LearnEveryDay
Starting Member

37 Posts

Posted - 2005-08-08 : 11:10:38
Thanks Madivanan,

I understand the table structure now.....

I am going to ask another question which is realated to this. That is

.net handles these structure very well in the front end...

But I dont know much about it. Is it good to use DataSet.Relation or DataView....

I know it is off the sql-question. I appreciate if someone answer me.

Thanks,
Pauline

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-09 : 00:50:31
It is better to post this question at .NET forums

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -