I have a table which contains lots of NULLs in the email field. What I need to do is updating all the NULL rows. For every NULL row, I need to execture a stored procedure which basically gets all the emails related to that user's ID. Therefore, for every NULL row, this stored procedure is called and all the email fields found within this stored procedure need to be concatenated together and inserted in place of the NULL email field from the other table.

Basically, instead of using the stored procedure I can simply use the select statement to get one row with all the necessary emails. What I essentially need to do is to concatenate these returned emails into one row.

1 Answer
1

Convert multiple rows into one row - SQL Server
As I need to send email to many people, i need to convert multiple emails into a single row delimited by semi-colon(;), i had lots of solutions, but which is an old type of solution which needs more lines of code. As i want to use one or two line code which would resolve, i found three methods for my solution which is very simple.