Send Email

I'm using SQL Server 7.
Does anyone know how to send out an email based on a query returning specific results?
I have *almost* got SQL Mail starting through Outlook/Internet Email/Exchange, although I don't know exactly how it works.
Any help appreciated.

TIA

Comments

  • : I'm using SQL Server 7.
    : Does anyone know how to send out an email based on a query returning specific results?
    : I have *almost* got SQL Mail starting through Outlook/Internet Email/Exchange, although I don't know exactly how it works.
    : Any help appreciated.
    :
    : TIA
    :

    "xp_sendmail" is a system store procedure in SQL 2000 . I am not sure that SQL 7.0 also has it. Perhaps it works...
    Here is the example and explanations....

    This example sends the results of the query SELECT * FROM INFORMATION_SCHEMA.TABLES as a text file attachment to Robert King. It includes a subject line for the mail and a message that will appear before the attachment. The @width parameter is used to prevent line breaks in the output lines.

    EXEC xp_sendmail @recipients = 'robertk',
    @query = 'SELECT * FROM INFORMATION_SCHEMA.TABLES',
    @subject = 'SQL Server Report',
    @message = 'The contents of INFORMATION_SCHEMA.TABLES:',
    @attach_results = 'TRUE', @width = 250


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion