• eagb (2/14/2013)


    This must be much simplier than I'm making it...

    I have an unique idenifier for a person, and a space delimited field containing grades they teach, since they could teach more than one grade I'm looking to have their unique idenifier and a single grade taught. I have a split list function but how do I do this...

    SELECT ID,

    (SELECT * FROM dbo.udfSplitList(Grades,' ')

    FROM TableA

    I know this is the wrong way and I get errors, any guidance would be great!

    Thanks!

    First, you really should provide the details of the error(s) you are getting. It really doesn't tell us anything when all you say is "I get errors."

    Second, it looks like dbo.udfSplitList is a table valued function. This is how you should be using it in this case:

    SELECT

    a.ID,

    sl.* -- not sure what the column or columns returned are or I would list them.

    FROM

    TableA a

    CROSS APPLY SELECT * FROM dbo.udfSplitList(Grades,' ') sl