syntax error with sp_send_dbmail

  • Hi,  am not sure why I am getting a syntax error when I try to execute the following stored proc.  When I try to run this query I get a message saying that there is a syntax error near the '+' sign.  The variable @slr has been previously assigned a value further up in my code.

    Any help is greatly appreciated.

    EXEC

    msdb.dbo.sp_send_dbmail

    @profile_name

    = 'sometext here',

    @recipients

    = @assignedToEmail,

    @copy_recipients

    = @createdByEmail,

    @subject

    = 'An Action has been created for '+@slr,

    @body

    = @message,

    @body_format

    ='HTML';

     

  • You can't use the variables there you have to change it.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply