• quite a few issues there.

    when you call sp_send_dbmail, you cannot append stuff togetierh for the paramters, you have to do that in advance, it has to be a single assignment, i thinkso it's a single static string, or a variable.if you need to put things together, it has to be done prior to teh proc call.

    ie like this:

    DECLARE @sqlcmd nvarchar(max) = 'SELECT ' + db_name() + ' As DB, Big Long Query featuring appending items together...'

    DECLARE @EmailList varchar(max) = 'lowell@somedomain.com' + ';' + 'tt-615680@anotherDomain.com'

    EXEC msdb.dbo.sp_send_dbmail

    @subject = 'Job Summary',

    @profile_name = 'SQL SMTP',

    @recipients = @EmailList,

    @body = @body,

    @body_format ='HTML',

    @query = @sqlcmd

    the seocnd piece is that you probably need to use something like this for part of your @bodyv variable, this is just a guess, but it's probably close:

    declare @body varchar(max)

    SET @body = '<table>

    <tr>

    <th>'

    + Db_name()

    +'</th>

    <th>' + CONVERT(VARCHAR,getdate(),111)

    + '</th>

    </tr>'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!