This is Scalar Function To trim Leading and trailing characters from string in SQL Server. As there is no in built function in sql server for the same. Using this one can trim leading/trailing any character(s) from string .
In this article, I explain about how to split a string with delimiter into list of rows. De limiter can be comma or plus our requirement is to convert a single row of a table into multiple rows based on number of delimiter.
How to get rows into comma separated values column in sql. Fetching rows values into comma separated column value is required lots of time in our projects. So I tried to achieve this and lastly found one solution. Use this to get all row values into one single column value with comma separation.
There is frequent need for sql string concatenation to get a list of column values(Comma separated value) of a table.
Generally udf's (Used Defined Function) are used to concatenate string in sql.
Here is a very simple T-SQL sample using FOR XML PATH() in order concatenate strings values in SQL SERVER