August 8, 2018 at 5:54 am
Set the parameter @exclude_query_output to 1.
From the documentation (sp_send_dbmail (Transact-SQL)):
[ @exclude_query_output= ] exclude_query_output
Specifies whether to return the output of the query execution in the e-mail message. exclude_query_output is bit, with a default of 0. When this parameter is 0, the execution of the sp_send_dbmail stored procedure prints the message returned as the result of the query execution on the console. When this parameter is 1, the execution of the sp_send_dbmail stored procedure does not print any of the query execution messages on the console.
Also, I assume you're trying to store the value of the mailitem_id to your variable. Don't use the format EXEC {Variable} = {Stored Procedure};, use the OUTPUT paramter, it's what it's there for. After ficing a couple of syntax error you had, you end up with:
Any question, please do ask.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
August 8, 2018 at 6:56 am
Perfect.
August 8, 2018 at 11:17 am
Thanks a lot
March 2, 2021 at 2:30 pm
This was removed by the editor as SPAM
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply