Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...You have made an incredible site which is truly a great help to me in solving problems. A tip of my hat to you!..."

Geography

Where in the world do Tek-Tips members come from?

Can SQL email me when certain database conditions are true? (novice)

lori (Programmer)
19 Jun 00 14:26
I'm very new to SQL.  No training yet.  I'd appreciate guidance on the following.  Once per day, I'd like SQL to examine records in a table and send email if certain conditions are true.  I'm trying to set up a 'reminder' system to bug my intranent content providers to send their content changes to me so I can post them in time.  This content could be updated on a weekly, monthly, or yearly basis and I don't want to use my Outlook Calendar.  I want to create records in an SQL table and have an SQL Job (?) execute an SQL stored procedure (?) to query my reminder table and send email via Outlook.  For example (in English): If today is Thursday, query the reminder table for all RemindOn='Thursday' then process each of those records by sending an email note to the RemindWho.  Sounds simple, but I'm not sure where to begin.  Thanks in advance.
BootMeUp (MIS)
23 Jun 00 14:52
Lori,
I believe you can use this with a little modification.
Use 'pubs' to test and then "lift" it to your application.
Open pubs - tables - then right click on 'titles' and select 'All tasks'.   Select 'manage triggers'.  Use code below to create trigger:  (I tested this on another server - if you'll send your email address, I'll send SQL email message to you when I change table - "saldridg@idwr.state.id.us"
Steve A.

USE pubs
IF EXISTS (SELECT name FROM sysobjects
        WHERE name = 'reminder' AND type = 'TR')
    DROP TRIGGER reminder
GO
CREATE TRIGGER reminder
ON titles
FOR INSERT, UPDATE, DELETE
AS
    EXEC master..xp_sendmail 'MaryM',
        'Message to user.'
GO

  

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close