troubleshooting Question

create UDF to concatenate multiple records from table

Avatar of MeritorWabco
MeritorWabco asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
2 Comments1 Solution219 ViewsLast Modified:
I need help creating a UDF to select the top 3 records and concatenate their values. This is for MS SQL 2005

My table
ID          Comment
0            T
0            h
0            i
0            s
1            a
1            b
2            a
3            a
3            b
3            c
3            d

So if i passed in ID 3 it would return
or if i passed in ID 2 it would return

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros