I have a web application that needs to fire off a long-running SQL Server procedure (to rebuild a table) when certain criteria are met. What is the recommended procedure to do this?
I was thinking, when the criteria are met a record would be inserted into the database and a scheduled SQL server job would check that table at a specified interval and fire off the procedure. It seems a little hackish though.
What is the preferred way to handle this? As a related question, what is the preferred way to handle future events (i.e. send an email 10 days after a user signs up?)
Is this type of scenario what messaging is all about?