Hello,I have created a report using the stored procuedre below which lists the documents within a folder and its sub fodlers...i would also like a column that lists the path of each document within the directory structure..is this possible?CREATE PROCEDURE dbo.sp_GetAllChildren_modify (
@DataID int,
@StartDate DATETIME,
@EndDate DATETIME) AS Declare
@Count int Declare
@SQL varChar(8000) set nocount on set
@Count = 1 CREATE TABLE #sp_GetAllChildren_Tmp ( ID int NOT NULL IDENTITY (1, 1), FolderLevel int NOT NULL, Name varChar(255), Version int, VerCDate DATETIME NULL ) ON [PRIMARY] While
@Count < 50 Begin Set
@SQL = 'insert into #sp_GetAllChildren_Tmp select ' + cast(
@Count as varchar(50)) + ', Name, DataID, ParentID, childCount, subtype, IsNull(datasize,0), IsNull(version, 0),vercdate from dtree A with (nolock) left outer join dversdata B with (nolock) on A.dataID = B.DocID WHERE' if
@Count = 1 Set
@SQL =
@SQL + ' dataID = ' + Cast(
@DataID as varchar(50)) else Set
@SQL =
@SQL + ' ParentID in (select dataID from #sp_GetAllChildren_Tmp where FolderLevel = ' + cast(
@Count-1 as varchar(50)) + ')' exec (
@RowCount = 0 BREAK ELSE Set
@Count =
@Count + 1 end select count(*) from #sp_GetAllChildren_Tmp AGO