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 2005 Forums
 Transact-SQL (2005)
 Hierarchy update all children

Author  Topic 

TheMaxx
Starting Member

5 Posts

Posted - 2007-11-06 : 09:58:57
I have structure:
FolderId, FolderName, ParentFolderId, FullPath

Data:
1, First, null, First
2, Second, 1, First/Sectond
3, Third, 2, First/Second/Third
and so on...

I need to do:
When change happens to column 'Name' i need to update FullPath, and FullPath of ALL children (and children's children and so on...)

Thank you.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-06 : 10:29:36
There are many examples in Books Online how to use recursive CTE's.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-06 : 11:18:24
Or just see the answer for your cross post here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=92165



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

TheMaxx
Starting Member

5 Posts

Posted - 2007-11-06 : 12:58:17
Can you please provide link, or topic to search.
Also, solution may be different for SQL 2000 and SQL 2005, that's why i posted in both forums.


quote:
Originally posted by Peso

There are many examples in Books Online how to use recursive CTE's.



E 12°55'05.25"
N 56°04'39.16"


Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-06 : 13:59:33
So you are just covering all your bases?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -