Click here to Skip to main content
14,669,422 members
Rate this:
Please Sign up or sign in to vote.
See more:
I m working with web application. In my database, I want to update automatically updated based on that. I m creating library managent. There are an option for book reservation. If somebody not come for get the book long period. The table of the status is automatically changed to 'cancel'. And also a mail is automatically send to particualar students sometimes. In that case even the application is not running that process are automatically should have to be done. Which one is best solutions for that case. Triggers or anything else?
Thanks in advance..
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

You can write a windows service or Console Application which will do it for you. The application periodically(you will set the interval) update that table based on your logic. In console application you can run it with the help of Windows Task Scheduler. I prefer Console app(running with Windows task scheduler) over Windows service development only because it is easier to develop/maintain.
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi,

you can make use of SQL server Agent Jobs, which will allow you to execute certain sql statements regularly after every specified interval, in other terms, this will help to execute sql statements in the scheduled manner.

refer below MSDN article for more on SQL JOBS.
MSDN-Implement Jobs[^]
Manage Job Steps[^]

hope it helps.
   
v2
Comments
Ankur\m/ 20-Mar-13 3:20am
   
Yes, SQL job is the way to go for his scenario.
Karthik Harve 20-Mar-13 5:37am
   
Thanks Ankur.!!:-)
Rate this:
Please Sign up or sign in to vote.

Solution 3

   
Rate this:
Please Sign up or sign in to vote.

Solution 4

Hi,
You can make a scheduler whch will check for the reservation and run it from the server-scheduled tasks.
   

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




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