I have this code but it only contains the last email.
I want to get everyones email in a string to send them email notifications.
like so
fred@nowhart.com, sue@gert.com, gerry@not.com
I was hoping to do this without looping using a cursor
I want to get everyones email in a string to send them email notifications.
like so
fred@nowhart.com, sue@gert.com, gerry@not.com
I was hoping to do this without looping using a cursor
Code:
DECLARE @results VarChar(1000)
SELECT @results = CASE
WHEN @results IS NULL THEN CONVERT( VarChar(20), [email])
ELSE ', ' + CONVERT( VarChar(20), [email])
END
FROM dbo.SOWEmailManagersHistory
Select @results
DougP