Concatenates the values of string expressions and places separator values between them. The separator is not added at the end of string.
STRING_AGG ( expression, separator )
Is an expression of any type. Expressions are converted to NVARCHAR or VARCHAR types during concatenation. Non-string types are converted to NVARCHAR type.
Is an expression of NVARCHAR or VARCHAR type that is used as separator for concatenated strings.
NVARCHAR or VARCHAR.
SELECT STRING_AGG ( ISNULL(FirstName,'N/A'), ',') AS csv FROM Person.Person;