Click here to Skip to main content
12,690,140 members (30,499 online)
Rate this:
Please Sign up or sign in to vote.
Suppose there are no. of users who wants to send the reminders (Email) before two days of given date in database automatically through Database using Sql sever and

Please help..

Suppose I have table
which contains
columns like Auto_id, user_id, email_id, Inspection_Date,IsInterested
so the Values for above Columns are

So if user is interested to see the details then value in "IsInterested" columns contains "Yes" then the email alerts should go before 2 days of given Inspection_Date automatically...

How to do it???
Please help....
Posted 28-Jan-13 18:41pm
Updated 28-Jan-13 19:14pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


You have to use Sql Agent Job for this purpose.
Using these you can Your logic in Stored Procedure then using sql job call it as per scheduled.

I also don't know more about that but i know your requirement can fulfill using this.
try to search it out.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Create an application to do the required job. And the create a schedule to run the application at required interval.
For example lets consider the scenario you mentioned above. Create an application which interacts with the database and gets the reminder time and formatted mail content. If the reminder time is less than equal to 2 days, send the mail and mark a flag in the database saying the reminder mail has been sent for this record.
Now create a schedule[^] to this this application everyday. You can decrease the time, depending on how close you want the mail to be sent based on time saved in database.

Also if you have a scenario where just SQL scripts can do the work, you can create SQL Jobs[^] to do the work for you.

Hope this helps!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100