I'm not a newbie, but I've not been able to find out how to do this
particular task, and BOL isn't being too cooperative.
My application sits on a SQL Server backend (SQL Server 2000).
The application is a Document Distribution system. Some subscribers
have elected to be notified by e-mail that a new revision of a document
is available.
I want to run a daily job that would search for new revisions and email
any electronic subscribers. Pseudo code example:
DECLARE MailList CURSOR FOR
SELECT
EMailAddress
FROM
Customers
INNER JOIN DocumentDistribution ON
Customers.CustomerID = DocumentDistribution.CustomerID
WHERE
DocumentDistribution.DocumentID = @DocumentID AND
Customers.EMailEnabled = 1
OPEN MailList
FETCH NEXT FROM MailList
WHILE @@FETCH_STATUS = 0
BEGIN
/* Format and send the email to the customer here */
FETCH NEXT FROM MailList
END
CLOSE MailList
DEALLOCATE MailList
What do I need to do on the server to make this work?
Many thanks in advance
Edward
--
The reading group's reading group:
http://www.bookgroup.org.uk