Hi @kkran ,
Actually your output will be truncated if you use below query:
Select FullMessage = Concat('Good Morning ' , Column3 , ':' + CHAR (13) + CHAR (10) ,
'Attached please find the '+ datename(month, dateadd(month,-1,getdate())) + ' ' + convert(varchar(4), Year(Getdate())) + ' report for review. Please direct reporting questions to Dev@gmail.com.' + CHAR (13) + CHAR (10) ,
'Report Name: ' + Column1 + CHAR (13) + CHAR (10) ,
'Program name: ' + Column2 + CHAR (13) + CHAR (10) ,
'Kindest regards, ' + CHAR (13) + CHAR (10) ,
'California Team' + CHAR (13) + CHAR (10) ,
'Director of Team')
from [table]
Output:
Good Morning John Doe:
Attached please find the August 2020 report for review. Please direct reporting questions to Dev@Stuff .com.
Report Name: California area Report
Program name: California Beach Program
Kindest regards,
California Team
Director o
Please refer the updated query from below:
declare @FullMessage nvarchar(max)
select @FullMessage = N'Good Morning ' + Column3 + ':' + CHAR (13) + CHAR (10) +
'Attached please find the '+ datename(month, dateadd(month,-1,getdate())) + ' ' + convert(varchar(4), Year(Getdate())) + ' report for review. Please direct reporting questions to Dev@gmail.com.' + CHAR (13) + CHAR (10) +
CHAR (13) + CHAR (10) +
'Report Name: ' + Column1 + CHAR (13) + CHAR (10) +
'Program name: ' + Column2 + CHAR (13) + CHAR (10) +
CHAR (13) + CHAR (10) +
'Kindest regards, ' + CHAR (13) + CHAR (10) +
'California Team' + CHAR (13) + CHAR (10) +
'Director of Team'
from [table]
print @FullMessage
Output:
Good Morning John Doe:
Attached please find the August 2020 report for review. Please direct reporting questions to Dev@Stuff .com.
Report Name: California area Report
Program name: California Beach Program
Kindest regards,
California Team
Director of Team
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.