Using SQL statement, If you are trying to build a string then you can use CHAR() to insert the ASCII character for the line break into your string.
The following 3 supported characters which are given below, but CHAR(10) is for creating a new line.
For example, if you want to use a word mail merge to list all your cats then you can use the following
If you want to use the word mail merge to list all vehicles you would use the following:
SELECT CHAR(10) + vehicles FROM T_Vehicles
STUFF and FOR XML PATH you can use inside a subquery.
For example, if you want to list all the vehicle that a person owns then the code should be written like this:
SELECT Person, STUFF
((SELECT char(10) + V.Vehicless FROM T_Vehicles V
WHERE TP.Person = V.Person
ORDER BY V.Vehicles ASC FOR XML PATH('')), 1, 1, '') AS Vehicles_Combined
FROM T_Persons TP
Learn all about SQL through this SQL Certification Course!