Can someone help me find a source of information or give me an example of a scheduled strored procedure ... is it even possible?
Here's the scenario:
I have a field in one of my tables "date_due," once a day I need to check this field and send an email to the owner of any record (thier email address is also stored in this table) where "date_due" is equal to today.
Any help would be greatly appreciated ... thanks!Write a DTS Package. Use an ActiveX object and write some VB code to connect to the DB, run the SP, then send out the necessary emails based upon the results of your SP (remember to close your DB connection at the end). Then schedule the DTS Package.|||Write a procedure to check the table. Use xp_sendmail to email to the appropriate recipients. Use SQL Server Agent to schedule a job that runs the procedure once a day. All this can be done easily and is easily researched in Books Online.|||derrickleggett,
Is xp_sendmail native to SQL Server 7.0+ or does it need to be set up seperately? Let me know ... thanks!|||xp_sendmail is part of SQL Server (including 7).
exec @.Severity = master..xp_sendmail
@.recipients = @.Recipients
, @.subject = @.Subject
, @.message = @.Message
No comments:
Post a Comment