Here is how i Solved this :-
;WITH CategoryListCTE AS
(
SELECT
pc.*
,CAST(ROW_NUMBER() OVER (ORDER BY pc.Ref_Category_ID) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN AS bc
FROM WikiApp_Category pc
WHERE pc.ParentID = 0
UNION ALL
SELECT
cc.*
,CategoryListCTE.bc + '.' + CAST(ROW_NUMBER() OVER (PARTITION BY cc.ParentID ORDER BY cc.Ref_Category_ID) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN
FROM WikiApp_Category cc
JOIN CategoryListCTE
ON cc.parentID = CategoryListCTE.Ref_Category_ID
)
SELECT
cl.Ref_Category_ID AS [Category_ID]
,cl.Category_Title AS [Category_Title]
,cl.Category_ShortName AS [Category_Short_Name]
,cl.Category_Desc AS [Category_Desc]
,cl.ParentID AS [Parent_Category]
,ISNULL(dbo.WikiApp_GetCategoryName(cl.ParentID),'N/A') AS [Parent_Name]
,CASE cl.AllowDelete
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS [AllowDelete]
,cl.IsDefault AS [Default]
,cl.IsActive AS [Active]
,CASE cl.IsDefault
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS [IsDefault]
,CASE cl.IsActive
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS [IsActive]
,cl.Created_By
,CONVERT(VARCHAR(20),cl.Created_DateTime,113) AS [Created_DateTime]
,cl.Last_Updated_By
,CONVERT(VARCHAR(20),cl.Last_Updated_DateTime,113) AS [Updated_DateTime]
,cl.Flag
FROM CategoryListCTE cl
WHERE cl.Flag = 1