I would like to have each persons name on a separate line.
instead of: Names > Castro, Pavel<br/>Espinal Guerrero, Danilo<br/> ...
I also tried + CHAR(13) + CHAR(10) and that did'nt work either.
DougP
instead of: Names > Castro, Pavel<br/>Espinal Guerrero, Danilo<br/> ...
I also tried + CHAR(13) + CHAR(10) and that did'nt work either.
Code:
DECLARE mycursor CURSOR LOCAL FAST_FORWARD FOR
Select Distinct top 5 Email from #TEMP
OPEN mycursor
-- Always true
WHILE 1 = 1
BEGIN
-- Get next record from cursor
FETCH NEXT FROM mycursor
INTO @Email
IF @@FETCH_STATUS <> 0
break
Else
Begin
Select @Names = @Names + ResourceLastName + ', ' + ResourceFirstName + '<br/>' from #TEMP
Where Email= @Email
end
Select @Email + ' Names > ' + @Names
Set @strBody = @Email + ' Names > ' + @Names
--Send the email to managers
EXECUTE ToolsTeam.[dbo].[uspSendEmail]
@strFromName
,'test1@one.verizon.com' --,test2@verizon.com' --@strTo
,@strCC
,@strBcc
,@strSubject
,@strBody
,@strSmtpServer
,@bReturnCode OUTPUT
,@strErrorMsg OUTPUT
set @Names = '
end
CLOSE mycursor
DEALLOCATE mycursor
DougP