Howdy, Stranger!

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

Categories

Send Email

paulj59paulj59 Member Posts: 420
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

  • bullaydinbullaydin Member Posts: 7
    : 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


  • Justin BibJustin Bib USAMember Posts: 0

    ________ / http://forcoder.org / free ebooks and video tutorials about \ Assembly, Objective-C, PL/SQL, Python, Perl, C, MATLAB, PHP, Visual Basic .NET, R, Swift, Ruby, C#, C++, JavaScript, Visual Basic, Delphi, Go, Java, Scratch Rust, ABAP, Lisp, Awk, Scala, Lua, VBScript, ML, SAS, Apex, Fortran, Crystal, Alice, FoxPro, Julia, Dart, LabVIEW, D, Bash, Hack, Kotlin, Erlang, Ada, F#, Prolog, Scheme, Logo, COBOL, Transact-SQL, Clojure \ _______

Sign In or Register to comment.