• I tried and I got another error for both @mytable and TestCategory

    Error:

    Msg 102, Level 15, State 1, Line 4

    Incorrect syntax near '.'.

    And I tried with select after cross apply. Again got the same error.

    select D.Item as [Category], COUNT(*) AS Count

    from dbo.TestCategory as T

    cross apply

    (

    select * from dbo.fnSplit(T.[Category],'/')

    ) as D

    group by D.Item

    I test the fnSplit() function and it's returning correct values

    select * from dbo.fnSplit('asp.net/c#/xml/html','/')

    Returns

    Item Number---Item

    1----------------asp.net

    2----------------c#

    3----------------xml

    4----------------html