automatically updating database values

lional

Well-known member
Joined
Nov 29, 2018
Messages
60
Programming Experience
Beginner
Hi everyone.
I am writing a small leave app for a friend. I have done most of it but I would like the accrued days to automatically increase with the allocated days per month and the database table to be updated. would this automation be done via the app or as a stored procedure in SQL Server. I just need direction so I can start my research on how to accomplish that. I am fairly new to C#.

Thank you and have a great day!
 
Traditionally, this would be done as a stored procedure, but recently I've been seeing more and more people doing things usually done in a database in the client side, or in the business logic code of a web service.
 
Thanks for your reply but to do these updates unattended often with the app not running, I would think maybe stored procedures may be the best way to go. Appreciate your feedback.
 
Stored procedures also don't run by themselves an automated manner. Stored procedures need to be called for them to run.
 
How would one have something that ran by itself unattended so that every month the staff's leave could have the allocated days added to there total leave
 
If you want to do it in the database, SQL Server Agent enables you to schedule tasks in the database itself. I imagine a number of other RDBMSes have similar tools. Alternatively, you can the Task Scheduler in Windows to run a program on a schedule. That might be a console application of your own that uses ADO.NET or the like to update the database, or you might use the SQL Server commandline interface, which I think is SQLCMD.
 
Why does the database need to be updated automatically when nobody is even using the data? Why can't the update be computed at the point in time when someone first accesses the database?
 

Latest posts

Back
Top Bottom