Hi @Chris Allen ,
Is it better to write the logic code into the View Controller for checking and setting the status every time the page is loaded, or create a SQL Agent scheduled job to update the database every 15 or 30 minutes? Or other better way that I am unaware of?
Both the above methods have advantages and disadvantages:
Write the logic code in the View Controller: By using this method, we could get the updated status in time, but if the logic code spends too much time, it will cause the lower performance.
Create a SQL Agent scheduled job: For the MVC controller, there is no need to change status, just access the table could get the updated status. But since the SQL job is running every 15 or 30 minutes, it might cause the status not updated in time.
So, you could consider creating a SQL Stored Procedure, in the Stored Procedure, you could query the table with join clause and the status logic code, and then get the latest status. In the MVC controller, you can call this stored procedure.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Dillion