I have some trouble with the sp_send_dbmail procedure.
I use the following code :
declare @Body varchar(500)
set @body = 'my text for server ' + @@servername
@subject = 'my_subject' ,
@recipients = 'my_email_adresse',
@query = @Body ,
@profile_name = 'my_profile'
But I have the following error :
Msg 22050, Level 16, State 1, Line 0
Error formatting query, probably invalid parameters
Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 504
Query execution failed: Msg 156, Level 15, State 1, Server [SERVERNAME], Line 1
Incorrect syntax near the keyword 'for'.
Do you know what I do wrong ?!
Thanks in advance !