I’ve got a table Folders with hierarchical information about folders:
FolderID FolderName ParentID
1 Folder1 0
2 Folder2 1
3 Folder3 2
4 Folder4 3
For Folder4 I would like to get the parent folders in the following format:
Folder1\Folder2\Folder3\
Note: I have asked this before, but I cannot use CTE because I am using SQL-Server 2000.
I’ve written a SQL function that should return what you’re looking for.