Click here to Skip to main content
15,886,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 asp.net.

Please help..

Suppose I have table
user_db
which contains
columns like Auto_id, user_id, email_id, Inspection_Date,IsInterested
so the Values for above Columns are
1,user1,a@yahoo.com,30-01-2013,Yes
2,user2,b@yahoo.com,01-02-2013,Yes
3,user3,c@yahoo.com,30-01-2013,Yes
4,user4,d@yahoo.com,01-01-2013,Yes

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
Updated 28-Jan-13 18:14pm
v2

Hello,

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.
 
Share this answer
 
v2
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!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900