Create Function Function_khcp_Catalogue_GetDirectory(@RecordID Char(36) = null, @IncludeCurrentNode Bit = 0)
Returns NVarChar(500)
As
Begin
Declare @First Bit
Set @First = 0
Declare @FDirectory NVarChar(500)
Declare @FName NVarChar(30)
Declare @FRecordID Char(36)
Declare @FParentID Char(36)
Set @FDirectory = ''
Set @FName = ''
Set @FParentID = @RecordID
While @First = 0 Or IsNull(RTrim(@FName), '') <> ''
Begin
Set @FName = ''
Set @First = 1
Select @FRecordID = RecordID, @FParentID = ParentID, @FName = Name From [khcp_Catalogue] Where RecordID = @FParentID
If IsNull(RTrim(@FName), '') <> ''
Begin
If @IncludeCurrentNode = 1 Or @FRecordID <> @RecordID
Begin
Set @FDirectory = RTrim(@FName) + '\' + @FDirectory
End
End
End
Return @FDirectory
End
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。