MS SQL 6.5 Procedure to Send Query results via Email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • serendipity

    MS SQL 6.5 Procedure to Send Query results via Email

    Hi,

    I'm not sure if this is possible as i've googled everywhere, but i have a
    select query that returns a customer record with their associated sales
    orders. I would like to automate a process which sends an email reminder to
    each customer in the database, that has outstanding orders. This email
    reminder should have the results of the query regarding their account.

    The table structure are as follows.

    ---------------------
    Customer_tbl
    ---------------------
    CustomerID
    AccountNo
    Name
    EmailAddress

    ---------------------
    Order_tbl
    ---------------------
    OrderID
    CustomerID
    Reference
    Amount
    Date
    Outstanding_flg


    Can anyone help?
    Sen.


  • John Bell

    #2
    Re: MS SQL 6.5 Procedure to Send Query results via Email

    Hi

    Posting DDL (Create table statements etc) and example data (as insert
    statements) will remove any ambiguity when people try to answer your
    questions.

    To send individual emails you will need to use a cursor to send separate
    emails to each customer. Check out xp_sendmail in Books online for details
    on how to send emails from SQL Server.

    You will have to be careful when configuring SQL Mail on SQLServer 6.5 and
    the version of outlook you use.

    INF: How to Configure SQL Mail
    Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.

    INF: Frequently Asked Questions - SQL Server - SQL Mail
    Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.


    HTH

    John

    "serendipit y" <abc@hotmail.co m> wrote in message
    news:40e12993$1 @news.syd.ip.ne t.au...[color=blue]
    > Hi,
    >
    > I'm not sure if this is possible as i've googled everywhere, but i have a
    > select query that returns a customer record with their associated sales
    > orders. I would like to automate a process which sends an email reminder[/color]
    to[color=blue]
    > each customer in the database, that has outstanding orders. This email
    > reminder should have the results of the query regarding their account.
    >
    > The table structure are as follows.
    >
    > ---------------------
    > Customer_tbl
    > ---------------------
    > CustomerID
    > AccountNo
    > Name
    > EmailAddress
    >
    > ---------------------
    > Order_tbl
    > ---------------------
    > OrderID
    > CustomerID
    > Reference
    > Amount
    > Date
    > Outstanding_flg
    >
    >
    > Can anyone help?
    > Sen.
    >
    >[/color]


    Comment

    • Krip

      #3
      Re: MS SQL 6.5 Procedure to Send Query results via Email

      Sen,

      If you have a machine with the .NET Framework that can connect to the
      SQL Server, give Gadami a try
      (http://www.kripsoft.com/pages/2/index.htm). Insert your database
      connection information and query in an XML file (see examples shipped
      with product), and run GadamiConfig.ex e to send the emails out. It
      has a 'burst' feature that will automatically send each set of orders
      to each customer. Merely tell the program what column in the query
      contains your email addresses and it will split the data and send out
      emails with HTML tables of the data.

      The product is free to use for sending out up to 100 emails at a time,
      and has a nominal cost if you want to send out more.

      -Krip

      Comment

      Working...