dbo.sp_send_dbmail, email results are all dashes "--------"

  • I am using the following sp to send myself an email. The results whether attached in a text file or sent in the body of the email get returned as all dashes.

    example:

    OcwenID --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- (0 rows affected)

    I have been searching google all night for an answer. Can someone help me? This is a new installation of SQL Server 2005 on a fresh server.

    I am using "msdb.dbo.sp_send_dbmail"

  • Here are some samples of setting up and sending database mail.

    http://cybersql.blogspot.com/2008/06/script-to-setup-database-mail.html

    One thing you can check is the sysmail_allitems table and see if there are any errors.

    SELECT * FROM sysmail_allitems

    You look like you are returning query results in the email. Are you sure the query produces output?

  • Your response did initiate some extra thought. I added a USE DATABASE; and now it is returning results. Thanks!

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

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