SQL Concatenation - Get column values as comma seperated list using XML PATH() instead of UDF's using SQL COALESCE
In my projects I frequently need sql string concatenation to get a list of column values of a table which may be called as child just as a column of a parent record which can be simply solved as sql concatenation methods. In this case it is possible to solve this t-sql concatenate problem by creating a udf (Used Defined Function). We can select the parent rows, and as an additional column in the select we can call the udf function which gathers and concatenate string in sql the child values as comma or semicolon seperated scalar value.
No comments yet, be the first one to post comment.