• Hi ,

    start with this article http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/.

    I would advise against using a scalar function and create a inline table function for perfomance reasons



    Clear Sky SQL
    My Blog[/url]