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)
 Searching tree path to some nodes in a hierchical structure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-15 : 07:39:58
KRISS writes "I have a table with these columns:

-acctID
-acctName
-acctParID

it forms a hierachical structure by linking the acctParID-acctID

I need a way to search this table by "acctName" like this

"select * from acct where acctName like '%test%'"

but I want all the rows up in the hierachy from the resultset above
that is the "path" from root.

... how can I accomplish this?

thank you for your time."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-16 : 02:38:10
See if this helps you
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=43485

Madhivanan

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

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-16 : 12:44:20
and here...

http://www.seventhnight.com/treestructs.asp

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page
   

- Advertisement -