I'm developing a hierarchy representaion of the column. But a mistake happens

Particulars are

Monosodium glutamate 240, Level 16, Condition 1, Line 1 Types don't match between your anchor and also the recursive part in column "DISPLAY" of recursive query "CTE".

I understand there's some typecasting error. However I dont understand how to remove error. Please just dont only straighten out my error. I want logic behind why this error is originating. If this error happens.

I'm attempting to sort table based on sort col which i m presenting. I wish to add '-' at each level and wish to sort accordingly.

Help

WITH CTE (PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH)
        AS
        (
            SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, '-' AS DISPLAY, '--' AS SORT, 0 AS DEPTH 
            FROM dbo.L_CATEGORY_TYPE WHERE FK_CATEGORY_ID IS NULL

            UNION ALL

            SELECT T.PK_CATEGORY_ID, T.[DESCRIPTION], T.FK_CATEGORY_ID, CAST(DISPLAY+T.[DESCRIPTION] AS VARCHAR(1000)), '--' AS SORT, C.DEPTH +1
            FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.PK_CATEGORY_ID = T.FK_CATEGORY_ID

            --SELECT T.PK_CATEGORY_ID, C.SORT+T.[DESCRIPTION], T.FK_CATEGORY_ID
            --, CAST('--' + C.SORT AS VARCHAR(1000)) AS SORT, CAST(DEPTH +1 AS INT) AS DEPTH
            --FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.FK_CATEGORY_ID = T.PK_CATEGORY_ID
        )
        SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH 
        FROM CTE            
        ORDER BY SORT

String constants have datatype CHAR, not VARCHAR in SQL Server.

You should utilize explicit cast:

WITH CTE (PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH)
        AS
        (
            SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, CAST('-' AS VARCHAR(1000)) AS DISPLAY, '--' AS SORT, 0 AS DEPTH 
            FROM dbo.L_CATEGORY_TYPE WHERE FK_CATEGORY_ID IS NULL

            UNION ALL

            SELECT T.PK_CATEGORY_ID, T.[DESCRIPTION], T.FK_CATEGORY_ID, CAST(DISPLAY+T.[DESCRIPTION] AS VARCHAR(1000)), '--' AS SORT, C.DEPTH +1
            FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.PK_CATEGORY_ID = T.FK_CATEGORY_ID

            --SELECT T.PK_CATEGORY_ID, C.SORT+T.[DESCRIPTION], T.FK_CATEGORY_ID
            --, CAST('--' + C.SORT AS VARCHAR(1000)) AS SORT, CAST(DEPTH +1 AS INT) AS DEPTH
            --FROM dbo.L_CATEGORY_TYPE T JOIN CTE C ON C.FK_CATEGORY_ID = T.PK_CATEGORY_ID
        )
        SELECT PK_CATEGORY_ID, [DESCRIPTION], FK_CATEGORY_ID, DISPLAY, SORT, DEPTH 
        FROM CTE            
        ORDER BY SORT