473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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.
Jul 20 '05 #1
2 3300
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
http://support.microsoft.com/?id=263556
INF: Frequently Asked Questions - SQL Server - SQL Mail
http://support.microsoft.com/?id=311231

HTH

John

"serendipity" <ab*@hotmail.com> wrote in message
news:40********@news.syd.ip.net.au...
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.

Jul 20 '05 #2
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.exe 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
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
1
by: Mónica | last post by:
I am trying to store the turn out of a stored procedure in a temporary table to make filters. I do it of the following way: SELECT a.* FROM OPENROWSET('SQLOLEDB', 'servidor';'user';'pwd' , 'EXEC...
5
by: mas | last post by:
I have a Stored Procedure (SP) that creates the data required for a report that I show on a web page. The SP does all the work and just returns back a results set that I dump in an ASP.NET...
1
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
3
by: Patrick | last post by:
Hi Can anyone tell me how can I send email through stored procedure in sql server ? I want to send attachment with this email too. TIA
4
by: jaYPee | last post by:
I have downloaded some source code but I want this to convert the results into datagrid. dr = cmd.ExecuteReader() '**************************************** ' SHOW THE RESULTS...
1
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try...
1
by: sxwend | last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.