-1

I'm doing a project called personal manager using ASP.NET 4.5 using C# and SQL Server 2012. As an example I store the details of driving license including it's expiry date.

What I want to do is to check this expiry date and present date and find whether it matches. If it matches I want to send a mail to the person informing the same.

I read about triggers and stored procedure but don't know how to implement this.

M4N
  • 94,805
  • 45
  • 217
  • 260
Sajjad
  • 68
  • 1
  • 6
  • There are plenty of tutorials on the Internet. See also DoMyHomework.com – Peter Smith Aug 28 '15 at 05:59
  • I suggest you do some research on SQL Agent - using this you can run a stored proc (or anything else) at a regular time. This is basically what you want to do. – Nick.Mc Aug 28 '15 at 06:24

1 Answers1

0

You have few option's to do it Use sql agent to run each day and then send email,

how to send email from ms-sql How to send email from SQL Server?

You can write some windows service to run query every day or hour and run query like select * from license where expiredate < DateNow() and AllReadySend=false

Then send email's from window service.

Community
  • 1
  • 1
Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
  • thanks janusz nowak for helping and i think you could support me in this regard in future. Thank you – Sajjad Aug 28 '15 at 08:20