February 3, 2009 at 6:21 am
Hi, Im using a select in sp_send_dbmail to provide the body of my email but I am also getting the row count
EXEC msdb..sp_send_dbmail
@profile_name = 'DB Mail',
@recipients = 'allen.davidson@europe.mccann.com',
@subject = 'UPSINCC Reveived Checks',
@query = 'SELECT CAST(Message AS CHAR(60)), COALESCE(CAST(Value AS VARCHAR(6)),'''') FROM UPSINCC..tblChecksInReportLine ORDER BY ID',
@query_result_header = 0,
@exclude_query_output = 1
my email looks like this
Received checks for file: 0903CALocalCheck.xls
Records sent = 221, records received = 221, OK
Changes to Contact_Name 2
Changes to Contact_Salutation 0
Changes to Contact_First_Name_3_Digit_FL 0
Changes to Contact_First_Name_IL 0
Changes to Contact_First_Name 1
Changes to Contact_Middle_Name 0
Changes to Contact_Last_Name 0
Changes to Contact_Job_Title 0
Changes to Contact_Business_Name 0
Changes to Contact_Address_Street 0
Changes to Contact_Address_Line_2 0
Changes to Contact_Address_City 0
Changes to Contact_Address_Postal_Code 0
Changes to Contact_Address_State 0
(16 rows affected)
Any ideas on how can I get rid of the (16 rows affected) message?
Thanks
Allen
February 3, 2009 at 6:33 am
put, at the top of the proc:
SET NOCOUNT ON
and at the bottom
SET NOCOUNT OFF
Max
February 3, 2009 at 7:27 am
Doh!
Thanks Max
February 3, 2009 at 5:49 pm
That's funny, if only I was there! 😀
Max
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply